Hey there,

Peter De Berdt a écrit :
> JavaScript doesn't allow file uploads, you have to use tricks like a
> hidden iframe to support "ajax" uploads.

Although the IFRAME trick sure is simpler and is the only way to upload
a file from the client's filesystem, I'm not convinced "JS doesn't allow
file uploads."

A file upload is nothing more than a POST request with proper request
Content-Type, and a multipart-wrapped, usually Base64-encoded, file
contents.

Which means that JS could synthetize the file contents and upload it.
However, JS *cannot* access files on the client's file system.  In this
regard, it cannot access an <input type="file".../>-defined file
contents from the local machine, and therefore cannot encode it and post
it manually.

This is, almost, a distinction without a difference, but I felt in a
mood for exactitude this morning :-)

-- 
Christophe Porteneuve aka TDD
[EMAIL PROTECTED]

--~--~---------~--~----~------------~-------~--~----~
 You received this message because you are subscribed to the Google Groups 
"Ruby on Rails: Spinoffs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-spinoffs?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to