javascript - 在頁面加載時,uploadify swf請求網址



asp.net flash (2)

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);}

在我的情況下,瑞士法郎的負載正在請求加載uploadify頁面的相同的url文件夾。

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

我在一個Asp.net站點上使用Uploadify,頁面的URL是/ Resource / Create / id,但是在頁面加載時,uploadify似乎是向該頁面的根網址/ Resource / Create /

這是導致服務器錯誤,因為沒有身份證提供和填補我的日誌,有沒有人知道它可以要求,如果它可以被設置為不請求這個URL。 這是我的JS:

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

Answer #1

我通過跟隨eugen對這個主題的評論解決了這個問題,

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(this.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





uploadify