Topic: Refresh upload create a wrong url?
Hi.
___Short:
After clear queue:
var uploader = $('#uploader').pluploadQueue('getUploader');
uploader.splice();
all settings of plupload are lost (setting are now default values?).
___Long:
I'm still testing pluploadQueue and I want upload only _one_ file.. this working very fine (Yes I want pluploadQueue for this). To make it work, I have add this:
FilesAdded: function(up, files)
{
var fileCount = up.files.length, ids = $.map(up.files, function(item) { return item.id; });
if (fileCount>1)
{
for (var i=1;i<fileCount;i++)
{
this.removeFile(up.getFile(ids[i]));
}
}
},
Now its can happen that I want to remove the uploaded file and upload another file again. But I can not refresh the page, because there are another inputs that I will not lost.
So I found this: http://stackoverflow.com/a/8851097/706420
And change it to (in my delete button):
var uploader = $('#uploader').pluploadQueue('getUploader');
uploader.splice();
The Queue is now empty and I can upload a file again. But this time I get a "HTTP error". I look in firebug and see thats plupload send now to a wrong url.
What is happen here? I think splice() recreate the whole setting as default?
In my setting I have:
filters: [
{
title: 'Image files',
extensions: 'jpg,gif,png'
}],
In my first dialog I see only images. After uploader.splice(); I see "all files". So I think I must set all my settings again.
But set:
uploader.settings.filters = [
{
title: 'Image files',
extensions: 'jpg,gif,png'
}];
don't help me here. I see always "all files" in upload dialog. What can I do?