Skip to content
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

FormData.append does not implement interface Blob #694

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

spatsatzis
Copy link

I had the following code

..... = new FileUploader.FileItem(uploader, {
size: 1e6,
name: name,
progress: 0,
isUploaded: false,
isSuccess: false
});

In chrome it is working great but in mozilla i get the following exception

Error: Argument 2 of FormData.append does not implement interface Blob.
I ended up at method " FileUploader.prototype._xhrTransport " and line 705

var sendable = new FormData();
......
sendable.append() method needs the second argument to be Blob, but now my code sends an object.

So i had either to do

..... = new FileUploader.FileItem(uploader, new Blob([{
size: 1e6,
name: name,
progress: 0,
isUploaded: false,
isSuccess: false
}]));

or fix it in FileItem constructor.

I had the following code

..... = new FileUploader.FileItem(uploader, {
                        size: 1e6,
                        name: name,
                        progress: 0,
                        isUploaded: false,
                        isSuccess: false
                    });

In chrome it is working great but in mozilla i get the following exception

Error: Argument 2 of FormData.append does not implement interface Blob.
I ended up at method " FileUploader.prototype._xhrTransport " and line 705

var sendable = new FormData();
......
sendable.append() method needs the second argument to be Blob, but now my code sends an object.

So i had either to do 

..... = new FileUploader.FileItem(uploader, new Blob([{
                        size: 1e6,
                        name: name,
                        progress: 0,
                        isUploaded: false,
                        isSuccess: false
                    }]));

or fix it in FileItem constructor.
@spatsatzis
Copy link
Author

Any thoughts?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant