Northern Flame Posted April 16, 2008 Share Posted April 16, 2008 I want to create a script that will upload an image via ajax. I know how to do this regularly with PHP, but my question is if I can upload the file without the user having to click a "Submit" button. So my question is if i can do something like this: <script type="text/javascript" src="upload_ajax.js"></script> <!-- the above file will be a simple ajax script that will pass the data to a php script via $_GET --> <input type="file" name="image" size="25" /><br /> <button onClick="uploadImage()"> Upload Image </button> with the uploadImage() function I can pass the path of the image on the users computer, but can I then upload it as I normally would with PHP using $_FILES? Link to comment https://forums.phpfreaks.com/topic/101312-solved-upload-via-ajax/ Share on other sites More sharing options...
shankar23 Posted April 19, 2008 Share Posted April 19, 2008 Hi good try.. As per i know you shall use Iframe layer.. thanks Shang.. Link to comment https://forums.phpfreaks.com/topic/101312-solved-upload-via-ajax/#findComment-521010 Share on other sites More sharing options...
Northern Flame Posted April 20, 2008 Author Share Posted April 20, 2008 alright thanks Link to comment https://forums.phpfreaks.com/topic/101312-solved-upload-via-ajax/#findComment-522039 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.