Jump to content

AJAX Upload File


Andrew K.

Recommended Posts

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

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

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

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

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...