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

Support Blob type #2

Closed
wants to merge 1 commit into from
Closed

Conversation

ArtNattapat
Copy link

IE11 not support new File(). must use Blob instead.

@jaydenseric
Copy link
Owner

Thanks for the PR 🙂

A heads-up that I won't have the time to properly review this for at least the next few days.

A brief, but related conversation: jaydenseric/apollo-upload-client#28 (comment).

@ArtNattapat
Copy link
Author

ie11 and edge can't create file with new File(['test file'], 'test.txt')
i think this just workaround for ie11 and edge(not support too) if need to upload blob.
or will be a shorthand upload by blob (not need to new File()).
but disadvantage on Blob is have no filename, and mine type like you told on related conversation.

my english is not good, sorry 🙁

@jaydenseric
Copy link
Owner

jaydenseric commented Aug 25, 2017

That's ok about the english 🙂

Because blobs are a little different to files this PR needs to be closely reviewed and tested across 4 related packages (extract-files, apollo-upload-client, apollo-fetch-upload, apollo-upload-server). Documentation across all would need to be updated. I am spread really thin for time right now, and because I don't need to support blobs for current deadlines this will just have to wait a while to be merged.

@ArtNattapat
Copy link
Author

I got it.
thank you ^^

@keeth
Copy link

keeth commented Nov 22, 2017

It seems I need Blob support too. I'm building a File object manually (from data URI after cropping an image), not using one from the File API.

Here's a minimal case that illustrates the problem. I found that the following seems to work in Chrome but not in Webkit:

var fd = new FormData(); 
fd.append('foo', new File(['abcd'], 'foo'));
fetch('http://mockbin.org/echo', {method:'POST', mode: 'cors', body: fd});

In Webkit, the 'foo' part body is empty.

However this works in both (using Blob instead of file):

var fd = new FormData(); 
fd.append('foo', new Blob(['abcd']));
fetch('http://mockbin.org/echo', {method:'POST', mode: 'cors', body: fd});

@jaydenseric
Copy link
Owner

jaydenseric commented Nov 22, 2017

I've been crazy busy with gen 2 uploads, which are are now in alpha. Other than preparing stable releases, this, along with #3 is my next priority.

@jaydenseric
Copy link
Owner

Thanks for looking into this, I tried to merge this before #5 so you would be included in the contributors list, but there were too many conflicts with the current master branch. Blob support is on the way!

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

Successfully merging this pull request may close these issues.

3 participants