Reputation: 6126
I am using Uploadify on a Asp.net site, the url for the page is /Resource/Create/id, but on page load uploadify appears to be making a request to the root url of that page /Resource/Create/
This is causing a server errors because no id is supplied and filling up my logs, does anyone know what it could be requesting and if it can be set to not request this url. Here is my JS:
var id = $('#fileUpload').attr('data-id');
$('#fileUpload').uploadify({
'swf': '/Scripts/Libraries/uploadify/uploadify.swf',
'uploader': '/Resource/Upload/' + id
})
Upvotes: 11
Views: 4595
Reputation: 378
troyanx, give me a nice tip, that works! Just replace in jquery.uploadify.js (.min or not):
this.settings.button_image_url = SWFUpload.completeURL(this.settings.button_image_url);
for:
if (this.settings.button_image_url != "") { this.settings.button_image_url = SWFUpload.completeURL(this.settings.button_image_url);}
In my case the load of swf was making a request to the same url folder of the page where uploadify was loading.
From: http://www.uploadify.com/forums/discussion/comment/16999#Comment_16999
Upvotes: 1
Reputation: 6126
I have resolved this issue by following eugen's comment on this thread,
Find following code in the upper part of the file:
this.settings.upload_url = SWFUpload.completeURL(this.settings.upload_url);this.settings.button_image_url = SWFUpload.completeURL(this.settings.button_image_url)
and rewrite it to:
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
Upvotes: 13