我正在尝试使用Jasny's file upload plugin。该插件似乎工作正常,但我无法访问实际文件,因此可以将其放入正确的目录。我唯一看到的是blob从控制台内部设置为缩略图,但无法访问它。以下是我到目前为止的情况:
[HTML]:
<form action="#" class="member_settings" id="member_settings" enctype="multipart/form-data">
<input type="text" name="member_name" class="span12 m-wrap" value="{{ @user_info.member_name }}" placeholder="Company Name" rel="tooltip" title="" data-placement="bottom" data-original-title="Company Name" >
<input type="text" name="member_email" class="span12 m-wrap" value="{{ @user_info.member_email }}" placeholder="Email Address" rel="tooltip" title="" data-placement="bottom" data-original-title="Email Address">
<div class="fileupload fileupload-new" data-provides="fileupload">
<div class="fileupload-new thumbnail" >
<img src="{{ @avatar }}" alt="" />
</div>
<div class="fileupload-preview fileupload-exists thumbnail" style="max-width: 150px; max-height: 150px; line-height: 20px;"></div>
<div class="span12">
<span class="btn btn-file"><span class="fileupload-new">Select New Image</span>
<span class="fileupload-exists">Change</span>
<input type="file" id="file" name="file" class="default" /></span>
<a href="#" class="btn fileupload-exists" data-dismiss="fileupload">Remove</a>
</div>
</div>
<div id="update_user_settings" class="btn green pull-right" style="margin:2px;"><i class="icon-check"></i> Update Profile</div>
</form>
[JS]:
<script>
$('#update_user_settings').click(function() {
$('.fileupload').fileupload({
url: '/api/upload/profile_img/{{ @SESSION.portal_id }}'
});
var post_url = "/api/update/user/details";
$.ajax({
type: "POST",
url: post_url,
data: $('#member_settings').serialize(),
dataType: "html"
});
});
</script>
我的问题是没有任何内容被发送到网址。我提交时在控制台中没有看到任何内容。
我见过的唯一教程在表单中使用整个fileuploader,但我要做的是允许用户进行所有需要的更改,然后应用它们。
我有什么遗失的吗?