You cannot access binary data with javascript - it is server side only - Ergo you cannot upload files with Ajax style comms.
Post to an Iframe to get round this or use flash uploaders (there are many) to interact directly to the client. Alex Mcauley http://www.thevacancymarket.com ----- Original Message ----- From: Vladimir Tkach To: prototype-scriptaculous@googlegroups.com Sent: Sunday, December 13, 2009 1:58 PM Subject: Re: [Proto-Scripty] Uploading an image with Ajax.request Like this one solution: http://github.com/markcatley/responds_to_parent 2009/12/12 Andy Daykin <daykina...@gmail.com> Hello, I was wondering if this is possible to do: I want to upload an image using Ajax.request like such: var form = $('addimage'); new Ajax.Request('http://myurl.com/uploadImage.php', { method: 'post', parameters: { image: $(form['image']).getValue() } } So far I haven't been able to access the image with php, I have been using $_FILES['file']['name'] to try and access the image, but I can't get it. Do I have to use an iframe for this, or will it work somehow using Ajax.request and trying to get the file in the form? Thanks, -Andy Daykin -- 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-scriptacul...@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. -- Best Regards, Vladimir Tkach +972-54-7574166 tea...@gmail.com http://teamco-anthill.blogspot.com/ http://www.google.com/search?q=teamco-anthill&pov=113485037116411478549&usg=__MJmWqpqtgaTxQA8ZMBvE3etiB1Q= -- 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-scriptacul...@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-scriptacul...@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.