Using an iframe to upload a file isn't too difficult and can be done
with almost any server side language, you simply post the form to the
frame as any other submission, then instead of displaying the page in
the iframe, have a snippet of code to execute a javascript method in
the parent window.
window.parent.domManager.setMessage("File transfer successful");
That statement will be executed when the frame has finished processing
the file, I found that to be the easiest way.
window references the current window, being the iframe, parent
references the containing window, being the main browser window.
domManager being some object that has element references, setMessage
being a function to insert the string into one of those elements.
I can't remember exactly how the file transfer comes across in the
form struct, but <cfdump/> is your friend and should explain things.
I believe the file gets saved to a tmp directory, and the name of
input is the property of the form object that contains the path to
this file.
On Sep 17, 2:37 pm, BrentNicholas <[EMAIL PROTECTED]> wrote:
> Matt,
>
> Thanks for the reply. Yeah, I found that js can't get at the file
> system and did a little looking around. I found this AJAX IFRAME
> METHOD (AIM) at:http://www.webtoolkit.info/ajax-file-upload.html
>
> At first glance it seems like a resonable solution, however now I have
> to figure out how to get ColdFusion to gain access to the form var
> that's passed over.
>
> Thanks again,
>
> BN
>
> On Sep 17, 12:04 pm, Matt Foster <[EMAIL PROTECTED]> wrote:
>
> > Greetings Brent,
>
> > Its not that Prototype has somehow neglected this aspect, but
> > simply the fact that an input type='file' cannot be transferred as you
> > have expected. Its value is a path, not the source of the file
> > itself. There are very strict rules on this input type for security
> > reasons. Javascript never has access to the source of the file so it
> > can't be placed into an XHR request. As you noted you can keep a
> > stateful web app and load the files via an off screen IFRAME. This
> > is the best approach while sticking to DHTML, there are more advanced
> > solutions using a Flash object but thus requiring your users to have
> > the plugin.
>
> > Regards,
> > Matt
>
> > On Sep 17, 12:14 pm, BrentNicholas <[EMAIL PROTECTED]> wrote:
>
> > > I've read that Prototype can not seralize files that have been
> > > selected for upload in the form. Found this out the hard way....
> > > "Hrmm. Every thing else loaded... where's my file?"
>
> > > Is this still the case?
>
> > > I've read that most people do an iFrame solution.
> > > Anyone have other ideas?
>
> > > Thanks for your time,
> > > BN- Hide quoted text -
>
> > - Show quoted text -
--~--~---------~--~----~------------~-------~--~----~
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 [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~----------~----~----~----~------~----~------~--~---