2012-09-11 84 views
11

我在Asp.net網站使用Uploadify,該頁面的網址是/資源/創建/ ID,但在頁面加載uploadify似乎正以根URL的請求該頁面/資源/創建/Uploadify SWF請求URL

這是導致服​​務器錯誤,因爲沒有ID提供和填滿我的日誌,有人知道它可以請求,如果它可以設置爲不請求這個URL。這裏是我的JS:

var id = $('#fileUpload').attr('data-id'); 
$('#fileUpload').uploadify({ 
    'swf': '/Scripts/Libraries/uploadify/uploadify.swf', 
    'uploader': '/Resource/Upload/' + id 
}) 

回答

13

我已經按照這個線程尤金的評論解決了這個問題,

http://www.uploadify.com/forum/#/discussion/7329/uploadify-v3-bug-unecessary-request-when-there-is-no-button_image_url-set-/p1

查找文件的上半部分以下代碼:

this.settings.upload_url = SWFUpload.completeURL(this.settings.upload_url); this.settings.button_image_url = SWFUpload.completeURL(此.settings.button_image_url)

,並將其改寫到:

this.settings.upload_url = SWFUpload.completeURL(this.settings.upload_url); this.settings.button_image_url = this.settings.button_image_url? SWFUpload.completeURL(this.settings.button_image_url): this.settings.button_image_url

1

troyanx,給我一個很好的提示,即作品!就在jquery.uploadify.js更換(.min與否):

this.settings.button_image_url = SWFUpload.completeURL(this.settings.button_image_url); 

爲:

if (this.settings.button_image_url != "") { this.settings.button_image_url = SWFUpload.completeURL(this.settings.button_image_url);} 

在我的情況SWF的負荷使頁面相同的URL文件夾的請求uploadify正在加載。

來自:http://www.uploadify.com/forums/discussion/comment/16999#Comment_16999