How do you get PHP to accept an uploaded file with a comma in the file name...

movefiles
movefiles used Ask the Experts™
on
How do you get PHP 5.x to accept the upload, to a web-based location via HTTP, of a file with a comma in the name and substitute for the comma with a more "acceptable" character even though the file must land first with the comma in the name?
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Top Expert 2008
Commented:
The comma character is valid in filenames, what you describe should not be a problem. Are you having problems with it? Can you post your code?

To replace the comma with something else, for instance an underscore, use str_replace() like this:

$filename = str_replace(',','_',$filename);
Top Expert 2008

Commented:
I answered the question, I provided code for replacing the comma with an underscore. In my opinion my answer http:#a24874906 should be acccepted.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial