gpt4 book ai didi

c# - Jasny Bootstrap 文件上传控件

转载 作者:行者123 更新时间:2023-12-01 02:59:20 24 4
gpt4 key购买 nike

我正在使用Jasny Bootstrap我的asp.net项目中的文件上传控件。

看起来确实不错,但我无法将附件发送到服务器(.ASHX Web 服务)

我的布局代码如下所示

<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>

最佳答案

HTML 包含 <input type="file" /> 。您需要设置输入元素的名称属性。另请确保您使用的是 enctype="multipart/form-data"形式。

<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>

关于c# - Jasny Bootstrap 文件上传控件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13243909/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com