Re: [Flashcoders] Flash File Upload using .NET
Hi, safe mode can have an effect on what chmod is allowed to do - you can't chmod a file if safe mode is on and your PHP script is not the owner... Shared hosting? I am not to sure about the mechanism behind FileReference so I don't know how it passes the data to the server, but if it is a POST you may be able to use php://input to grab the stream directly and work around the chmod issue? Glen On Fri Oct 20 4:52 , 'Carl Welch' [EMAIL PROTECTED] sent: I've found that when uploading using FileReference, my files end up being read only by the owner (chmod 600). Which in turn doesn't allow ___ Flashcoders@chattyfig.figleaf.com 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
RE: [Flashcoders] Flash File Upload using .NET
a file if safe mode is on and your PHP script is not the owner... This thread was never about PHP was it? Or was that a side question Carl asked? Jason Merrill Bank of America Learning Organization Effectiveness - Technology Solutions ___ Flashcoders@chattyfig.figleaf.com 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
Re: [Flashcoders] Flash File Upload using .NET
Jason good point about .net and so easy to use with uploading. Tony... - Original Message - From: Merrill, Jason [EMAIL PROTECTED] To: Flashcoders mailing list flashcoders@chattyfig.figleaf.com Sent: Friday, October 20, 2006 5:44 AM Subject: RE: [Flashcoders] Flash File Upload using .NET I've found that when uploading using FileReference, my files end up being read only by the owner (chmod 600). I have never found that to be an issue in my experience. We have an app that you use FileReference to upload the file to an ASPX page, then another button you can then use to load the file into the application using LoadMovie(). Jason Merrill Bank of America Learning Organization Effectiveness - Technology Solutions ___ Flashcoders@chattyfig.figleaf.com 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 ___ Flashcoders@chattyfig.figleaf.com 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
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 ___ Flashcoders@chattyfig.figleaf.com 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 ___ Flashcoders@chattyfig.figleaf.com 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
RE: [Flashcoders] Flash File Upload using .NET
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=10/ -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 ___ Flashcoders@chattyfig.figleaf.com 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 ___ Flashcoders@chattyfig.figleaf.com 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 ___ Flashcoders@chattyfig.figleaf.com 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
RE: [Flashcoders] Flash File Upload using .NET
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=10/ -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 ___ Flashcoders@chattyfig.figleaf.com 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 ___ Flashcoders@chattyfig.figleaf.com 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 ___ Flashcoders@chattyfig.figleaf.com 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 ___ Flashcoders@chattyfig.figleaf.com 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
Re: [Flashcoders] Flash File Upload using .NET
I've found that when uploading using FileReference, my files end up being read only by the owner (chmod 600). Which in turn doesn't allow the file to be read back into my swf Does anyone know of a way to make it chmod to 644? I 've tried to make php set it to the proper chmod but to no avail. Or maybe someone can enlighten me to what may be causing this I did set the php to safe_mode off - In hopes that would help me solve the issue -- but no, it didn't... Cheers. -- Carl Welch http://www.carlwelch.com [EMAIL PROTECTED] 805.403.4819 ___ Flashcoders@chattyfig.figleaf.com 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