On Jan 9, 2013, at 3:45 PM, Jason Westbrook wrote:

> It is possible but you have to realize it will only work on browsers that 
> have the FileAPI available - Chrome/Firefox/Safari
> 
> 
> new 
> Ajax.Request("fileupload.php?filename=myfile",{"postBody":$("inputfield").files[0]});
> 
> will post the contents of the file to fileupload.php
> 
> then you can use 
> 
> file_get_contents("php://input");

Note that this style of upload will not have the same security treatment by PHP 
as the $_FILES superglobal variable, and move_uploaded_file() and friends will 
not be active for it either. This can become an awful security hole if you 
aren't careful.

> 
> to get the contents of the file
> 
> and the filename will be $_GET['filename']
> 
> 

If you want to use the normal upload mechanism, you can use a "keyhole" iframe 
as the target in your form action to post your file contents normally, and a 
callback function in the window scope of the containing page to signal back 
your updates. It looks like Ajax, but it's really just a multipart form post.

Walter

> 
> 
> Jason Westbrook | T: 313-799-3770 | jwestbr...@gmail.com
> 
> 
> On Wed, Jan 9, 2013 at 12:27 PM, fntzr <fantaz...@gmail.com> wrote:
> It not possible, use Flash Uploader for it, for example 
> http://demo.swfupload.org/v220/simpledemo/index.php.
> 
> But with HTML5\xhr2 it will be possible.
> http://dev.w3.org/2006/webapi/FileAPI/#FileReader-interface .
> 
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Prototype & script.aculo.us" group.
> To post to this group, send email to prototype-scriptaculous@googlegroups.com.
> To unsubscribe from this group, send email to 
> prototype-scriptaculous+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/prototype-scriptaculous?hl=en.
> 
> 
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Prototype & script.aculo.us" group.
> To post to this group, send email to prototype-scriptaculous@googlegroups.com.
> To unsubscribe from this group, send email to 
> prototype-scriptaculous+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/prototype-scriptaculous?hl=en.

-- 
You received this message because you are subscribed to the Google Groups 
"Prototype & script.aculo.us" group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com.
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en.

Reply via email to