Upload file and send through ajax form

Hello there,

I use an element attached in this zip (assets file is missing due to the file size and i don’t think its necessary for what i need to ask).

Its actually a button with a pop up form, where the user fills in the name, lastname, e-mail and e-mail confirmation, telephone(optional), question/comment, send copy to my e-mail fields.

Inside this, i need to add an extra field, where the user can upload his/her cv (doc, docx, txt, rtf, pdf file types) and when click on send the user will receive the CV file also along with the other information.

I tried to add an Upload field called cv inside the code, but when i click on send, i have message:
Invalid file type
but the message is sent and at the e-mail i see all the info but i see the file name of cv, not the file.

Any help with this please?A friend of mine that took a look told me that this form sends info via ajax and that i have to change the way that the information is being sent in order to be able to send the file.

Thank you in advance

Many say its not possible, others say you can by converting the file to a string and sending it, but there are loads of “plugins” which will do it for you, here was the first I came across: http://www.dropzonejs.com/

The standard way send files over http with javaScript is to use a iframe as a proxy to the server-side logic used to handle the file. If you search google using those terms something should turn up. I believe there are other more modern methods but they aren’t backward compatible with older versions of IE where as the iframe method is compatible all around.

From a quick search this link explains the iframe method ok: