Home Tutorials Forums Articles Blogs Movies Library Employment Press Buy templates

Go Back   ActionScript.org Forums > Flash General Questions > Flash 8 General Questions

Reply
 
Thread Tools Rate Thread Display Modes
Old 10-25-2005, 09:13 AM   #1
salzbermat
Registered User
 
Join Date: Oct 2005
Posts: 1
Default FileReferenceList upload IOError on Mac

We have a filereference upload set up and working uploading to a PHP script
on an apache server.
It's a multiple upload script with FileReferenceList and a PHP script that
moves the files and inserts to database.
The file upload works well using Win XP (IE, Firefox, Opera).
On the Mac (safari, Firefox), we get IOErrors, the files won't upload. There
is no authentication necessary, nor are there any restrictions for filenames
etc. as the documentation suggests. We're not starting sessions, as we got
errors that way, too. We tried on several machines all with latest flash
player installed, it works on the PC, doesn't on the mac.
We tried on two different servers, I even removed all PHP code from the
upload script just to make sure it's not a server-side problem, so obviously
there is something awkward happening on the Mac.

Any suggestions?
Thanks,
Bernd
salzbermat is offline   Reply With Quote
Old 01-09-2007, 09:47 PM   #2
cg_flipper
Registered User
 
Join Date: May 2003
Posts: 9
Default

anyone have a solution to this... i've pinpointed the problem to file names containing spaces on the mac
cg_flipper is offline   Reply With Quote
Old 02-26-2007, 03:30 PM   #3
kalbster
Registered User
 
Join Date: Aug 2005
Posts: 7
Default

You can check the filename before the user uploads. Alert the user if a file contains unwanted ascii characters such as a space. I had the same problem with mac users. This is also useful if you have people uploading files from different countries that may contain characters in a different character set.

Code:
	function checkFileName(filename:String):Boolean{
		trace("*** checkFileName() ***: " + filename);

		//var fileNameNoExt:String = getFileName(filename);
		var fileNameNoExt:String = filename;
		trace("fileNameNoExt: " + fileNameNoExt);
		
		var nameOK:Boolean = true;
		
		for (var i:Number = 0; i < fileNameNoExt.length; i++) {
			
			if ((fileNameNoExt.charCodeAt(i) >= 97 && fileNameNoExt.charCodeAt(i) <= 122)
				|| (fileNameNoExt.charCodeAt(i) >= 65 && fileNameNoExt.charCodeAt(i) <= 90)
				|| (fileNameNoExt.charCodeAt(i) >= 48 && fileNameNoExt.charCodeAt(i) <= 57)
				|| fileNameNoExt.charCodeAt(i) == 95 || fileNameNoExt.charCodeAt(i) == 45 || fileNameNoExt.charCodeAt(i) == 46 || fileNameNoExt.charCodeAt(i) == 32){
					//trace(fileNameNoExt.charAt(i));
			}
			else {
				nameOK = false;
				trace("ERROR @ " + i + " STRING: " + fileNameNoExt.charAt(i));
				showAlert("Bad Character", "The '" + fileNameNoExt.charAt(i) + "' character is not allowed. \nPlease change the name of file: " + filename + " and try again.")
				i = fileNameNoExt.length;
			}//end if
			
		}	
		return nameOK;
	}//checkFileName(filename:String)	



public function onSelect(ufile:flash.net.FileReferenceList) {
...
if(checkFileName(ufile.fileList[i].name)){
 //this is a vaild file do something with it.
}
...
}
kalbster is offline   Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 07:01 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2009 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.