Andrew K. Posted July 26, 2007 Share Posted July 26, 2007 Okay so I've been looking around and I noticed AJAX upload file doesn't exactly exist.Is there an alternative method besides iFrames? Would I be able to use *insert server side language here*AJAX? Link to comment Share on other sites More sharing options...
Synook Posted July 26, 2007 Share Posted July 26, 2007 You could use PHP combined with AJAX to upload a file, so that when you click "submit" on a form it posts the file details from a file input via AJAX to a PHP script that uploads the file... Link to comment Share on other sites More sharing options...
aspnetguy Posted July 26, 2007 Share Posted July 26, 2007 you can use AJAX and any server side language to upload a file. Link to comment Share on other sites More sharing options...
jesh Posted July 26, 2007 Share Posted July 26, 2007 I've never successfully uploaded a file using AJAX. Anyone have any sample code? Link to comment Share on other sites More sharing options...
Andrew K. Posted July 26, 2007 Author Share Posted July 26, 2007 Are you both talking about CFAJAX or just regular AJAX? Because I think you're both talking about normal Ajax and I keep reading that it's impossible. Link to comment Share on other sites More sharing options...
aspnetguy Posted July 26, 2007 Share Posted July 26, 2007 http://digg.com/programming/Use_Ajax_To_Upload_Filesit not done completely through AJAX but needs some help from an iframe it still achieves the same end.This (http://www.captain.at/ajax-file-upload.php) however is pure AJAX upload, mind you it only works in Firefox and requires a bit of tweaking by the user but it would be a suitable solution for a closed intranet or software backend. Link to comment Share on other sites More sharing options...
justsomeguy Posted July 26, 2007 Share Posted July 26, 2007 Javascript is not able to read a file on your local computer, it would need to do that in order to upload it to the server. It is a major security hole if Javascript is able to read your files.The code on the captain.at site opens such a security hole in Firefox. Apparently the Firefox developers thought it would be a good idea if they made a setting that allows Javascript to read local files, and that is what the code takes advantage of. Following the instructions on that page to enable that option leaves your computer open to having any file read and sent to any server if you are using Firefox. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.