SWFUpload 无法将文件上传到 asp.net

发布于 2024-08-03 03:57:20 字数 1584 浏览 5 评论 0原文

我已将 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

方觉久 2024-08-10 03:57:21

看起来上传 URL 仍然设置为 localhost。

It looks like the upload URL is still set to localhost.

情话墙 2024-08-10 03:57:21

如此答案中所述,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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文