Error - Empty (0 bytes) Excel received

I am trying to import Excel file based on the sample from here I'm getting "Error - Empty (0 bytes) Excel file received". Am I still missing something?


Stupid question first: Do you have content in the file?

Have you tryed with the example file?

Valid question. Yes. There are 4 records and a header row. Do I need to have the correct header columns that match the entity attributes before the file being recognized?


@Tim Le

You must use a button with Method set to Submit.

You have some tips here:


Yes, João Heleno is right.

Just to extend a little bit the explanation, what makes the difference between this behavior is the "content-type" used in an ajax or a submit.

If you inspect the requests, you can see that the ajax will use:

text/html; charset=utf-8

Using the "Submit" option you will have the following content type:

Mime type - multipart/mixed 

In the end, this means that you can have different types of data inside the content of this request. Inside of the body, this contents are separated between types. The binary file will be one of them.

Hope this could help you find the reason behind this :)

Kind regards