I have a <div/>
tag which contains a file upload <input id="file" type="file"/>
tag. I want to post the contents of the input
tag to a php page using $.ajax()
or $.post()
but how do I grab the contents of the input
tag having its type as "file"
? so I can submit it using the jQuery ajax functions?
Note: My code doesn't have a <form/>
tag yet. I am not sure if its mandatory to upload files. Also i've seen some workarounds using <iframe>
I want to know if this can be done otherwise.
I don't want to use any plugins to do this.