I have a file input box on my page, which is created by the following HTML:
& lt; Input type = "file" id = "imagefile" accept = "picture / gif" /> I am using file input to upload the file using the Imagehack API. The API says that I need to send the following parameters:
fileupload; (Input type = "file") - image or video file. Unless the URL parameter is specified, it is mandatory.
I am using the jquery $ .post method, but how do I reference the file that the user has selected in the input box? Thanks for reading.
EDIT: Code formatted.
Assuming that I understand your question is correct, I do not believe this $ .post Or it is possible through any other AJAX method, because file uploads are securely protected by the browser. The best method I can think is to submit the relevant form to an invisible iframe.
Comments
Post a Comment