all groups > flash actionscript > september 2005 >
You're in the

flash actionscript

group:

File upload



Re: File upload ryando
9/20/2005 2:18:20 PM
flash actionscript: As seen here:http://www.communitymx.com/content/article.cfm?cid=513FF

-------------------------------------------------------------------------------------------------

Probably the most requested feature in the history of Flash is the
ability to upload files via Flash Player. This has been available in
HTML for years via the <input type="file" /> tag. Now, thanks to the
great engineers at Macromedia, we can finally do this in Flash without
some kludgy JavaScript, hidden-frame solution. There is a nice new API
called FileReference that is used to prompt the user for a file and
send it to the server. The following code shows just how simple this
really is:

import flash.net.FileReference;

function onSelect(selectedFile:FileReference):Void {
selectedFile.upload("http://www.somelocation.com/Upload.cfm");
}

var imageFile:FileReference = new FileReference();
imageFile.addListener(this);
imageFile.browse([{description:"Image Files",
extension:"*.jpg;*.gif;*.png"}]);

Code 1 Uploading an image to the server using the FileReference class.
File upload knucklenutz
9/20/2005 8:38:39 PM
Hey all,

I know this topic has been covered before but I couldn't seem to get a
straight answer from previous posts. I am interested in uploading an image to
a Flash movie. I was hoping to use PHP since I don't have ColdFusion
technology running on my server. I have gathered enough information to know
that I need to pop open a new window containing the PHP/HTML to browse to a
particular file then upload it. My question lies in how do I direct that new
file to the Flash movie? I figure there is some JS function that allows me to
pass the URL back to the movie when it is done uploading? Any information is
greatly appreciated.

Thanks in advance!
Re: File upload knucklenutz
9/20/2005 9:12:07 PM
Rather than UPLOAD the file to a server then load it into the Flash movie. Is
there a way to browse a users hard drive for an image file and load it into the
flash movie from the local drive? Or do Flash's security setting prevent this.
This was the file could be loaded into the movie from the local drive without
uploading it. And the user could still use a print function to print the image
from Flash which is why I am loading an image in the first place. To print it.


Thanks!
AddThis Social Bookmark Button