Hi Sander,
Thanks again for all this trouble. I made this modification so I replaced
event.formData.append("import-context", new
Blob([JSON.stringify(this.importContext)], { type: "application/json"}));
by
event.formData.append("import-context", new
Blob([JSON.stringify(this.importContext)],
{ type: "application/json"}),"import-context");
The HTTP payload is as follows:
------WebKitFormBoundary8KpdAMW6dgaX8oBA Content-Disposition: form-data;
name="excel-files"; filename="exportTranslations.xls" Content-Type:
application/vnd.ms-excel ------WebKitFormBoundary8KpdAMW6dgaX8oBA
Content-Disposition: form-data; name="import-context";
filename="import-context" Content-Type: application/json
------WebKitFormBoundary8KpdAMW6dgaX8oBA--
As you can see, this doesn't change much. Previously, without using the
filename as a parameter, the Blob constructor generated a default file name
of "Blob". Now, explicitly specifying it, the filename is "import-context",
but the content of the Blob is still empty.
Would you see anything else I could do such that to get things working ?
Many thanks in advance,
Nicolas
Le vendredi 15 septembre 2017 12:08:13 UTC+2, Sander Elias a écrit :
>
> That looks better. should work, hold on..
>
> event.formData.append("import-context", new Blob([JSON.stringify(this.
> importContext)], { type: "application/json"}),"import-context");
>
> I think that should work. You forgot to add the filename to the part.
> You realize none of this is connected to angular at all? ;)
>
> Regards
> Sander
>
--
You received this message because you are subscribed to the Google Groups
"Angular and AngularJS discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.