SWFUpload 无法将文件上传到 asp.net
我已将 swfupload 放入我的网站,但在选择要上传的文件后,处理上传文件的页面未收到文件。我假设 swfupload 没有将文件上传到服务器...
中的简单代码
这是我在 javascript / var swfu
window.onload = function() {
var settings =
{
file_size_limit: "1000", // 200 kb
file_types: "*.jpg;*.gif;*.png",
file_types_description: "Image Files",
file_upload_limit: "10",
file_queue_limit: "10",
upload_url: "http://localhost:4158/Membership/ExportFromFlash.aspx?action=gadget",
flash_url: "/Html_Data/Flash/swfupload.swf",
button_width: "100",
button_height: "20",
button_placeholder_id: "swfuploadContainer",
button_text: '<span>Upload your gadgets</span>',
button_text_style: ".theFont { font-size: 8; }",
button_text_left_padding: 12,
upload_error_handler: uploadError,
upload_success_handler : uploadSuccess
}
swfu = new SWFUpload(settings);
};
function uploadError(file, errorCode, message) {
try {
alert(message);
} catch (ex) {
alert("ASDF");
this.debug(ex);
}
}
function uploadSuccess(file, serverData) {
try {
alert(serverData);
//window.navigator("/Membership/GadgetDetails.aspx");
} catch (ex) {
alert("A33");
this.debug(ex);
}
}
;我使用 Visual Studio .net 调试页面,但没有达到......
I have put the swfupload to my site but after choosing the files to upload, the page that handle the uploaded files didn't receive the files. I assuming the swfupload isn't uploading the files to the server ...
this is my simple code in javascript /
var swfu;
window.onload = function() {
var settings =
{
file_size_limit: "1000", // 200 kb
file_types: "*.jpg;*.gif;*.png",
file_types_description: "Image Files",
file_upload_limit: "10",
file_queue_limit: "10",
upload_url: "http://localhost:4158/Membership/ExportFromFlash.aspx?action=gadget",
flash_url: "/Html_Data/Flash/swfupload.swf",
button_width: "100",
button_height: "20",
button_placeholder_id: "swfuploadContainer",
button_text: '<span>Upload your gadgets</span>',
button_text_style: ".theFont { font-size: 8; }",
button_text_left_padding: 12,
upload_error_handler: uploadError,
upload_success_handler : uploadSuccess
}
swfu = new SWFUpload(settings);
};
function uploadError(file, errorCode, message) {
try {
alert(message);
} catch (ex) {
alert("ASDF");
this.debug(ex);
}
}
function uploadSuccess(file, serverData) {
try {
alert(serverData);
//window.navigator("/Membership/GadgetDetails.aspx");
} catch (ex) {
alert("A33");
this.debug(ex);
}
}
I used the visual studio .net debugging the page but it didn't reach....
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
看起来上传 URL 仍然设置为 localhost。
It looks like the upload URL is still set to localhost.
如此答案中所述,Flash 9.x /10.x 不允许调用函数。因此,您必须显示 Flash 控件以使其可点击。
Google Mail 似乎将“附加文件”按钮作为普通的超链接,但在其顶部放置了一个(透明)Flash 对象(按照 z 顺序),以便用户看到 HTML 超链接但点击 Flash 对象。
As described in this answer, Flash 9.x/10.x does not allow to call a function. So you have to display the Flash control to make it clickable.
Google Mail seems to make the "Attach a file" button as a normal hyperlink but place a (transparent) Flash object on top (in terms of z-order) of it so the user sees the HTML hyperlink but clicks the flash object.