-
Notifications
You must be signed in to change notification settings - Fork 53
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
upload-queue and MaxFileSize Filter #12
Comments
Hmm... this is strange. Could you provide a pull request of a test that shows this happening? The easiest way to add a test for this would be to add a test case to the end of import File from "ember-plupload/system/file";
test('files get associated with the correct error', function (assert) {
var queue = UploadQueue.create();
var uploader = queue.configure();
// Pass in the file added by plupload here
var file = {
id: 1,
name: 'my-file'
};
queue.pushObject(File.create({
uploader: uploader,
file: file
}));
// Pass in the object that you see being triggered by plupload here
uploader.Error(uploader, {});
assert.ok(get(file, 'error'));
}); |
@AdrienNguyenWorldline please let me know if the solution is sufficient for your needs. Thanks! |
This is perfect and also allow me to have directly access to the file and it's error if there is one. However upgrading to version 0.6.10 now gives me |
Oh dear. This sounds like the dynamic stylesheet I added. What browser are you using again? (And version, please!)
|
Both Chrome 42.0.2311.135 and Firefox 37.0.1 fail. |
Hmm. If you can provide the template that you're using for uploads, then I should be able to help you more. I'll need to turn on a debug build of plupload to see exactly where it's failing
|
We have a simplie template : with an |
@AdrienNguyenWorldline Thanks! I'll see if I can break it |
At a first glance, your template is providing a few things that will no longer work (see the changelog for details on that). Specifically, the headers and URL are now set in the action: file.upload('/api/docs/upload', {
headers: uploadHeaders
}) |
With the action parameters moved to the upload method call everything works well. file.upload('/api/docs/upload') see #16 for unit test. |
@AdrienNguyenWorldline Merged and fixed. Thanks for the tests :) |
I Have looked at upload-queue.js
When we are using a file size filter the
onError
is called.I see that the goal is to put file related errors attached to the file and global errors to the queue itself.
In our case we have an error related file (error.file not null).
But the
var file = this.findProperty('id', error.file.id);
returns undefined.thus making
set(file, 'error', error.file);
failI have no idea why we have no files in queue at this time.
But I tried adding the error globally in that case
The text was updated successfully, but these errors were encountered: