Skip to content
This repository has been archived by the owner on Jan 10, 2024. It is now read-only.

Problem with xlsx and docx #96

Open
builderdege opened this issue Jan 18, 2018 · 2 comments
Open

Problem with xlsx and docx #96

builderdege opened this issue Jan 18, 2018 · 2 comments

Comments

@builderdege
Copy link

Hi,

You have a problem with this code:
var blob = new Blob([ "--boundary_" + boundary + '\n' + "Content-Disposition: form-data; name=\"entity_content\";" + "\n" + "Content-Type: application/json" + "\n\n" + JSON.stringify(fields) + "\n\n" + "--boundary_" + boundary + "\n" + "Content-Type: application/octet-stream" + "\n" + "Content-Disposition: form-data; name=\"" + payloadField + "\"; filename=\"" + filename + "\"\n\n", payload, "\n\n" + "--boundary_" + boundary + "--" ], {type : 'multipart/form-data; boundary=\"boundary_' + boundary + '\"'});

It should be:
var blob = new Blob([ "--boundary_" + boundary + '\n' + "Content-Disposition: form-data; name=\"entity_content\";" + "\n" + "Content-Type: application/json" + "\n\n" + JSON.stringify(fields) + "\n\n" + "--boundary_" + boundary + "\n" + "Content-Type: application/octet-stream" + "\n" + "Content-Disposition: form-data; name=\"" + payloadField + "\"; filename=\"" + filename + "\"\n\n", payload, "\n" + "--boundary_" + boundary + "--" ], {type : 'multipart/form-data; boundary=\"boundary_' + boundary + '\"'});

The extra line corrupts the xlsx and docx files.

Thanks,
Yishay

@pbergner
Copy link

Thanks Yishay!

@yassin014
Copy link

hello i want to help you guys

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

No branches or pull requests

3 participants