Hey, I'm currently doing a little series on JavaScript programming <http://www.thinkingphp.org/2006/12/30/a-php-developers-guide-to-javascript-part-i/> on my blog and I think this would be an excellent tutorial for one of my upcoming posts. So if you can wait I might write up an excellent how-to guide about this soon.

If you can't, here is the basic things you need to do (and I highly recommend you to use jQuery instead of prototype for it!):

  1. Attach an event to the <form>'s onSubmit event
  2. In the callback function, create an iframe on the fly, hide it and
     set the form's 'target' attribute to match the name (or id I
     forgot) of the iframe
  3. Attach an onLoad function to the iframe
  4. Then execute the form submit event yourself
  5. In the onLoad callback of the iframe you should be able to access
     it's content (I think). Otherwise return some JS in the iframe
     that will pass some variables to window.parent, making them
     available to your real site

Of course this isn't complete, but I hope it helps.

-- Felix

--------------------------
http://www.thinkingphp.org
http://www.fg-webdesign.de


Ámon Tamás wrote:

Marcelo Linhares wrote:

I used iframe, I was the only solution that I found.

I know this is the only solution (because security), but how You can send the file to the iframe and how get back the results with javascript (for example with prototye)?


[]s
Marcelo Linhares

2007/1/3, Erich C. Beyrent <[EMAIL PROTECTED]>:

Maybe this will help:

http://seemysites.net/projFolder/uploader/


Ámon Tamás wrote:
>
> [EMAIL PROTECTED] wrote:
>>
>> AJAX itself can't handle file upload. It's a big no no apparently and a >> security hazard if it was allowed...however, what goes on is there is
>> an iframe and the file upload takes place there within that form.
>
> Ok. I know, this is not an easy thing, but I like a site to work it
> because it is look like very cool (:) and I like to know how it is work > really. I stolled the code from Drupal, but it is very big and not easy > to understand it. (And this is written with jquery, but it is not a big
> problem.)
>
> I only want to know how I can send a file to the server (with AJAX or
> JavaScript) and How I can get back the response from this iframe. I
> don't want any progress bar and other feature, only this. But when try > to find tutorials howtos everything speaking about progress-bars, what
> is not very interesting for me now.
>
>>
>> There are several tutorials on this, TJSinglton linked one there,
>> here's another: http://seemysites.net/projFolder/uploader/
> Ok. I take a look in it (Uber-Uploader, but I think this is not what I
> want).
>>
>> and if you need further info, use my custom search engine on my blog:
>> http://www.concepthue.com/blog
>> to read more about the whole thing, I have several pages I included
>> with info on this as I was just working with this a few weeks ago.
>>
>> In the end....and after getting it to work...I decided not to use it
>> lol, but hopefully this will be of some help.
>>
>>
>> >
>
>

>


>



--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" 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/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to