Actually, what I'm trying to do is simulate the FILE input field to
Upload a file against a CFML page. Strangely, I've tried and tried and
the CF page doesn't fail or error, it just doesn't upload the file.

It acts like the contentType isn't being set or as if it doesn't
recognize the fact that I'm trying to UPLOAD a file.



Again, here's the FLASH:
======================================
function respond(){
 goToAndPlay("My Scene",1);
 stop();
}
 
function upload(){
 dtsVars = new LoadVars();
 dtsVars.myfile="c:\test.txt";
 dtsVars.onLoad=respond;
 dtsVars.contentType="multipart/form-data";
 dtsVars.sendAndLoad("http://192.168.0.2/upload.cfm",dtsVars,"POST";);
}
 
upload();
stop();



Here's the CFML to process the upload:
======================================
<cfif isdefined("myfile")>
        <cffile action="UPLOAD" filefield="myfile" destination="d:\"
nameconflict="MAKEUNIQUE">
        <cfoutput>&start=1&myfile=#myfile#&success=true</cfoutput>
<cfelse>
        <cfoutput>&start=1&myfile=failed&success=false</cfoutput>
</cfif>


Anyone have any clues? I'm going to try Matt's idea with the chromeless
window if I can't actually use ActionScript.

Does anyone from Macromedia have a suggestion? Can you upload files to
CF from FLASH ???


Joshua Miller
Head Programmer / IT Manager
Garrison Enterprises Inc.
www.garrisonenterprises.net
[EMAIL PROTECTED]
(704) 569-9044 ext. 254
 
************************************************************************
*************
Any views expressed in this message are those of the individual sender,
except where the sender states them to be the views of 
Garrison Enterprises Inc.
 
This e-mail is intended only for the individual or entity to which it is
addressed and contains information that is private and confidential. If
you are not the intended recipient you are hereby notified that any
dissemination, distribution or copying is strictly prohibited. If you 
have received this e-mail in error please delete it immediately and
advise us by return e-mail to [EMAIL PROTECTED]
************************************************************************
*************


-----Original Message-----
From: Jason Miller [mailto:[EMAIL PROTECTED]] 
Sent: Wednesday, January 08, 2003 8:25 PM
To: CF-Talk
Subject: Re: CF / Flash Question


Simulate input field?
Why don't you just use the dynamic text field - check the borders.

set it's property to dtsVars.myfile - so it pops in "c:\test.txt" so it 
looks like you are actually submitting the form....

perhaps I am missing what you intend.
Also on teh SendAndLoad - you don't need both urls.... it would look
like
dtsVars.sendAndLoad("http://192.168.0.2/upload.cfm",dtsVars,"POST";);

Lastly - to check it the send and load was a success you would do -
dtsVars.onLoad = function(success){
       
        if(success){          
            // whatever you want flash to do if send and load was 
successful like  
           goToAndPlay("My Scene",1);
        }

Hope I actually answered your question :)

jason miller

Joshua Miller wrote:

>Anyone know if something like this is possible with FlashMX ?
> 
>function respond(){
> goToAndPlay("My Scene",1);
> stop();
>}
> 
>function upload(){
> dtsVars = new LoadVars();
> dtsVars.myfile="c:\test.txt";
> dtsVars.onLoad = respond;
> dtsVars.contentType = "multipart/form-data";  
>dtsVars.sendAndLoad("http://192.168.0.2/upload.cfm",dtsVars,"POST
><http://192.168.0.2/upload.cfm> ");
>}
> 
>upload();
>stop();
> 
>It shure would be nice to have the ability to simulate the <input 
>type="file"> field within Flash.
> 
>Is there another way to send file uploads from Flash? Can I embed an 
>HTML form in Flash???
> 
>Joshua Miller
>Head Programmer / IT Manager
>Garrison Enterprises Inc.
>www.garrisonenterprises.net <http://www.garrisonenterprises.net/>
>[EMAIL PROTECTED]
>(704) 569-9044 ext. 254
> 
>***********************************************************************
>*
>*************
>Any views expressed in this message are those of the individual sender,
>except where the sender states them to be the views of 
>Garrison Enterprises Inc.
> 
>This e-mail is intended only for the individual or entity to which it 
>is addressed and contains information that is private and confidential.

>If you are not the intended recipient you are hereby notified that any 
>dissemination, distribution or copying is strictly prohibited. If you 
>have received this e-mail in error please delete it immediately and 
>advise us by return e-mail to 
><mailto:[EMAIL PROTECTED]>
>[EMAIL PROTECTED]
>***********************************************************************
>*
>*************
> 
>
>

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: 
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Your ad could be here. Monies from ads go to support these lists and provide more 
resources for the community. http://www.fusionauthority.com/ads.cfm

                                Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
                                

Reply via email to