Thanks a lot guys!!!

I had also searched myself and found something on CodeProject that almost fixed 
the
solution, but it did the upload on PostBack which made it somewhat limited in
usefulness for working with a live Flash app.

Thanks,
liam m-

--- "Brake, Stephen" <[EMAIL PROTECTED]> wrote:

> Liam, I found this code after searching for hours on the net.  I'm not
> sure of its original source, but this works for me.  It should place the
> file in the root (or virtual directory if using virtual directories
> under a root)
> 
>             string saveToFolder = string.Empty;
>             HttpFileCollection uploadedFiles = Request.Files;
>             string Path = Server.MapPath(saveToFolder);
>             for (int i = 0; i < uploadedFiles.Count; i++)
>             {
>                 HttpPostedFile F = uploadedFiles[i];
>                 if (uploadedFiles[i] != null && F.ContentLength > 0)
>                 {
>                     string newName =
> F.FileName.Substring(F.FileName.LastIndexOf("\\") + 1);
>                     F.SaveAs(Path + "/" + newName);
>                 }
>             }
> 
> 
> If you are going to be uploading large files, the web.config file should
> be changed to allow this.  The size and timeout properties are up to the
> individual to decide.
> 
> //<httpRuntime executionTimeout="600" maxRequestLength="100000"/>
>        
> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] On Behalf Of Merrill,
> Jason
> Sent: Thursday, October 19, 2006 11:49 AM
> To: Flashcoders mailing list
> Subject: RE: [Flashcoders] Flash File Upload using .NET
> 
> Yes, I use the FileReference class and call an aspx page, attaching
> variables to the URL string.  Works great.  There is lots of information
> on using the Filereference class in the help docs.  However, if you want
> to know how to write the script (C#, VBScript, whatever) to receive and
> process the file, I have a C# aspx script, but might get in trouble for
> sending it to you  - I would try a .NET forum for that. On the Flash
> side, this is part of my media upload class that does the magic:
> 
> private function browse(mediaTypes_arr:Array):Void{
>       fileRef = new FileReference();
>       fileRef.addListener(listener_obj);
>       fileRef.browse(mediaTypes_arr);
>       listener_obj.type = type_str;
>       listener_obj.projId = projId;
>       listener_obj.onSelect = function(file:FileReference):Void {
>               var uploadString:String =
> "/Upload.aspx?ProjId="+this.projId +"&type="+this.type;
>               if(!file.upload(uploadString)) {
> trace("Upload dialog failed to open.");
>               }
>       }
>       listener_obj.onCancel = function(){
>               ..etc.
> 
> Jason Merrill
> Bank of America 
> Learning & Organization Effectiveness - Technology Solutions 
>  
>  
>  
>  
>  
> >>-----Original Message-----
> >>From: [EMAIL PROTECTED] [mailto:flashcoders-
> >>[EMAIL PROTECTED] On Behalf Of Liam Mincy
> >>Sent: Thursday, October 19, 2006 11:12 AM
> >>To: Flashcoders mailing list
> >>Subject: [Flashcoders] Flash File Upload using .NET
> >>
> >>Hi, I was wondering if anyone knew of a source or a way to get file
> uploads to
> >>work
> >>under ASP.NET 2.0 through Flash? I have found examples of doing this
> under PHP
> >>and
> >>ColdFusion, but nothing that does file uploads without the postback
> under .NET
> >>
> >>Thanks,
> >>liam m-
> >>
> >>__________________________________________________
> >>Do You Yahoo!?
> >>Tired of spam?  Yahoo! Mail has the best spam protection around
> >>http://mail.yahoo.com
> >>_______________________________________________
> >>[email protected]
> >>To change your subscription options or search the archive:
> >>http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
> >>
> >>Brought to you by Fig Leaf Software
> >>Premier Authorized Adobe Consulting and Training
> >>http://www.figleaf.com
> >>http://training.figleaf.com
> _______________________________________________
> [email protected]
> To change your subscription options or search the archive:
> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
> 
> Brought to you by Fig Leaf Software
> Premier Authorized Adobe Consulting and Training
> http://www.figleaf.com
> http://training.figleaf.com
> _______________________________________________
> [email protected]
> To change your subscription options or search the archive:
> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
> 
> Brought to you by Fig Leaf Software
> Premier Authorized Adobe Consulting and Training
> http://www.figleaf.com
> http://training.figleaf.com
> 


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 
_______________________________________________
[email protected]
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com

Reply via email to