2013-02-25 57 views
0

我在我MVC3 program.It使用SWFUpload的效果很好,在IE和Chrome.But我的文件不能在FireFox.It上傳甚至沒有進入上傳操作。 在我的程序中,用戶應該先登錄。當我在測試程序中使用SWFUpload時,用戶不必登錄,它也可以很好地工作。 任何人都可以告訴我如何解決這個問題? 這是我的代碼:的SWFUpload在FireFox

Js: 
    swfupload1 = new SWFUpload({ 
     upload_url: '@Url.Action("Upload")', 
     post_params: { "name": "value" }, 

     file_size_limit: "200000000", 
     file_types: "*.jpg;*.gif;*.png;*.jpeg", 
     file_types_description: "", 
     file_upload_limit: "1", 
     file_queue_limit: "1", 

     file_queue_error_handler: fileQueueError, 
     file_dialog_complete_handler: fileDialogComplete, 
     file_queued_handler: fileQueued, 
     upload_progress_handler: uploadProgress, 
     upload_error_handler: uploadError, 
     upload_success_handler: uploadSuccess, 
     upload_complete_handler: uploadComplete, 
     upload_start_handler: uploadStart, 

     button_image_url:'@Url.Content("~/Swfupload/images/XPButtonNoText2_160x22.png")', 
     button_placeholder_id: "spanButtonPlaceholder1", 
     button_width: 42, 
     button_height: 22, 
     button_text: '<span class="buttonCss">選擇</span>', 
     button_text_style: ".buttonCss { font-family: Helvetica, Arial, sans-serif; font-size: 14pt; } .buttonSmall { font-size: 10pt; }", 
     button_text_top_padding: 1, 
     button_text_left_padding: 5, 
     button_cursor: SWFUpload.CURSOR.HAND, 
     button_action: SWFUpload.BUTTON_ACTION.SELECT_FILE, 

     flash_url: '@Url.Content("~/Swfupload/swfupload.swf")', 
     custom_settings: { upload_target: "divFileProgressContainer1" }, 

     debug: false 
    }); 

控制器:

[HttpPost] 
    public ActionResult Upload(HttpPostedFileBase filedata) 
    { 
     if (null != filedata) 
     { 
      filedata.SaveAs(Server.MapPath("/File/Coverurl"+fileData.FileName)); 
     } 
     return Json(""); 
    } 
+0

我看不出有任何的代碼檢查登錄狀態或不。 – Raptor 2013-02-25 09:18:07

+0

不,不檢查。我只是不知道問題是什麼。它對會話有影響嗎? – Sasori 2013-02-25 09:40:25

+0

這是你說的要求:'在我的程序,用戶應登錄first.' – Raptor 2013-02-25 09:57:14

回答