How can I send a file and other data together?
When saving files and other data you should go the following way:
- send files to server;
- (optionally ) get response of uploading script and use its data. Described here;
- save the form data via Ajax POST request;
- (optionally) get response from a form-saving script and use its data.
Study the following docs for details:
I read it, but I need to send with the file name of the user in whose directory it should be put.