2

I am working on Blob object to upload files. The default file sent to server is 'blob'. I want to overide it and set to the original file name.

I saw a similar question in Stack Overflow and the answer suggested to use

form.append("blob",blob, filename);

But this would work only on chrome and FF.

Anybody knows how to do it in Internet Explorer Version 10+.

Thanks in Advance, Br, Rohit PAI

Community
  • 1
  • 1
Rohit Pai
  • 67
  • 1
  • 6
  • I would just send the name in another parameter `form.append("blobname", filename);` – Musa Aug 21 '14 at 19:58
  • @ Musa - Yes I agree with you. I dont have access to change the server side implementation and it works only on the file key present in the content deposition. – Rohit Pai Aug 22 '14 at 02:22

1 Answers1

-1

You can create a File object using your blob object:

var temporalFile= new File([blob], 'correctName.txt'); 
form.append("blob", temporalFile);
  • 3
    You missed something here, the problem was that `FormData.append`'s `fileName` property wasn't working in IE (btw I'm unable to repro this isssue myself). According to [this](http://caniuse.com/#search=File) the `File()`constructor is not supported in any version of IE. That won't work as a workaround. – Kaiido Apr 09 '16 at 04:23