Jasny Bootstrap文件上传控件 [英] Jasny Bootstrap File Upload Control

查看:6027
本文介绍了Jasny Bootstrap文件上传控件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用在我的asp.net项目Jasny引导文件上传控制。



它看起来确实不错,但即时通讯无法附加的文件发送到服务器(web服务ashx的)



我的布局代码看起来象

 < DIV CLASS =文件上传文件上传新数据提供=文件上传 > 
< DIV CLASS =输入追加>
< DIV CLASS =不可编辑输入span3>< I类=图标文件文件上传-存在>< / I> <跨度类=文件上传预览>< / SPAN>< / DIV><跨度类=BTN BTN文件><跨度类=文件上传新>选择文件< / SPAN><跨度类=文件上传-存在>变化与LT; / SPAN><输入类型=文件/>< / SPAN>< A HREF =#类=BTN fileupload-存在数据解雇=文件上传>删除< / A>
< / DIV>
< / DIV>


解决方案

的HTML包含< ;输入类型=文件/> 。您需要设置input元素的name属性。另外,还要确保你使用 ENCTYPE =的multipart / form-data的的形式。

 <形式的行动=myscript.ashx方法=POSTENCTYPE =的multipart / form-data的> 
< DIV CLASS =文件上传文件上传新数据提供=文件上传>
< DIV CLASS =输入追加>
< DIV CLASS =不可编辑输入span3>< I类=图标文件文件上传-存在>< / I> <跨度类=文件上传预览>< / SPAN>< / DIV>
<跨度类=BTN BTN文件><跨度类=文件上传新>选择文件< / SPAN><跨度类=文件上传-存在>变化与LT; /跨度><输入类型=文件名称=myupload/>< / SPAN>
< A HREF =#类=BTN文件上传,存在数据解雇=文件上传>删除< / A>
< / DIV>
< / DIV>
< /表及GT;


I am using Jasny Bootstrap file upload control in my asp.net project.

It looks really good, but im unable to send the attached file to the server (a .ASHX webservice)

My layout code look like this

<div class="fileupload fileupload-new" data-provides="fileupload">
<div class="input-append">
<div class="uneditable-input span3"><i class="icon-file fileupload-exists"></i> <span class="fileupload-preview"></span></div><span class="btn btn-file"><span class="fileupload-new">Select file</span><span class="fileupload-exists">Change</span><input type="file" /></span><a href="#" class="btn fileupload-exists" data-dismiss="fileupload">Remove</a>
</div>
</div>

解决方案

The HTML contains an <input type="file" />. You need to set the name attribute of the input element. Also make sure that you're using enctype="multipart/form-data" in the form.

<form action="myscript.ashx" method="post" enctype="multipart/form-data">
  <div class="fileupload fileupload-new" data-provides="fileupload">
    <div class="input-append">
      <div class="uneditable-input span3"><i class="icon-file fileupload-exists"></i> <span class="fileupload-preview"></span></div>
      <span class="btn btn-file"><span class="fileupload-new">Select file</span><span class="fileupload-exists">Change</span><input type="file" name="myupload"/></span>
      <a href="#" class="btn fileupload-exists" data-dismiss="fileupload">Remove</a>
    </div>
  </div>
</form>

这篇关于Jasny Bootstrap文件上传控件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆