Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Different content-type when uploading using input field and drag'n'drop #273

Closed
ukasiu opened this issue Jul 20, 2014 · 6 comments
Closed

Comments

@ukasiu
Copy link

ukasiu commented Jul 20, 2014

Hi,
when uploading simple csv file on Chrome/Debian using $upload.upload and file input field I get Content-Type: text/csv in the request to a server, whilst using $upload.upload and drag'n'drop for the same file I get Content-Type: application/octet-stream.

Is that a known issue? Is it possible to override Content-Type when uploading using $upload.upload?

@danialfarid
Copy link
Owner

If you use $upload.upload() the content-type of the request being sent to the server will always be multipart/form-data.

@ukasiu
Copy link
Author

ukasiu commented Jul 21, 2014

I don't mean the content-type of the request, but the content-type of uploaded file declared in the request.

@danialfarid
Copy link
Owner

What do you mean by uploaded file declared in the request? Can you send the snapshot of what you see in the request.

@ukasiu
Copy link
Author

ukasiu commented Jul 21, 2014

That's what I get when sending by input field:
image
That's what I get when sending by drag'n'drop (now on Windows, same thing happens):
image

@danialfarid
Copy link
Owner

Fixed in version 1.6.1.
That is probably a bug in chrome file drop webkitGetAsEntry().file() which doesn't return the correct type for the file. In this version I am using the regular evt.dataTransfer.files if the dropped item is not a directory. So this bug would still be present in Chrome if you drop a directory.

@ukasiu
Copy link
Author

ukasiu commented Jul 21, 2014

Thanks a lot.

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

No branches or pull requests

2 participants