I recently ran into this problem. So, I searched a bit and found some answers.
It is working fine. But if I add the file field to the html form, it will not send the file to the server.
The serialize() method used in the doc example. But according to jQuery doc :
Data from file selection items is not serialized.
In addition, there is no clear way to get the ajax file to load, since JS does not have access to the outside of the client browser. Thus, I do not think dajaxice can be used.
The simplest hack I found is to submit the form to an invisible iframe using the target option:
<form method='POST' action='/upload' enctype='multipart/form-data' target='submit-iframe'>
so, only iframe will be updated. Using js, you can get data from it by catching the load() event.
A more detailed process is described here.
source share