2013-03-14 51 views
0

我正在使用fileuploadfield上傳文件。Fileupload在FireFox中不起作用

代碼片段:

myUploadForm.getForm().submit({ 
    url: 'ref/uploadData', 
    waitMsg: 'Uploading file...', 

    success: function(form, action) { 
     alert('sueccess'); 
    }, 

    failure:function(form, action) { 
     alert('failure'); 
    }  
}); 

和後端(Grails的)我得到的響應對象 {成功:真,名稱: '等'}。

這裏的問題是這是在鉻和IE罰款。 但在Firefox中它不起作用。 它正在下載名爲請求的url方法的文件,並在該文件中寫入響應。

即, uploadData {成功:真, 名稱:「等」}

凡在螢火蟲的網片我能看到正確的效應初探。 這個問題只在FireFox中。

任何幫助將非常感激。

問候 網址

回答

0

在控制器中嘗試設置如下

response.contenttype ="text/html" // sometimes not required. 
render ("{ success: true, result:'file has been uploaded succesfully'}") 

這個工作對我..試試看。