CodeCharge Studio
search Register Login  

Web Reporting

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> PHP

 [Solved] Strange problem with uploaded filenames containing character

Print topic Send  topic

Author Message
Markie


Posts: 251
Posted: 02/27/2009, 10:24 AM

I have noticed a very strange thing happening while uploading a file which name contains a '.
For example:

photo '99.jpg

The uploaded file is renamed to

photo \99.jpg

and now all kinds of errors occur, because my system can't interprete the \ character.

Is this a known problem ?
_________________
The Netherlands, GMT+1
Tools: CCS 5.1, Windows 7, Navicat, Ultraedit
Local server: XAMPP with Apache, php and MySQL
Webserver: Windows 2008 IIS 7, php and MySQL
View profile  Send private message
jjrjr1


Posts: 942
Posted: 02/27/2009, 10:39 AM

Yes A Known Problem

Fix Here:

http://ccselite.com/forums_topics_view.php?forum_id=2&forum_topic_id=63


_________________
John Real - More CodeCharge Studio Support at - http://CCSElite.com
View profile  Send private message
Markie


Posts: 251
Posted: 02/28/2009, 12:46 AM

Hi John, your solution doesn't work with the ' character here. It's still replaced with the \ character on my server.
_________________
The Netherlands, GMT+1
Tools: CCS 5.1, Windows 7, Navicat, Ultraedit
Local server: XAMPP with Apache, php and MySQL
Webserver: Windows 2008 IIS 7, php and MySQL
View profile  Send private message
damian

Posts: 838
Posted: 02/28/2009, 1:19 AM

some characters just arent going to work....
why cant users stick to 8.3?

_________________
if you found this post useful take the time to help someone else.... :)
View profile  Send private message
Markie


Posts: 251
Posted: 02/28/2009, 2:27 AM

John,

your solution does seem to work and the ' character is replaced with a _ character, but it's preceeded by a \

for example:

photo class of '99.jpg

is renamed to

photo_class_of\_99.jpg

and the backslash gives all kinds of problems, I think it's because php uses the addslashes function. I have solved this problem with this:

$uploadfile = $uploaddir . stripslashes($filename);

and now everything is fine !

Thanks again !
_________________
The Netherlands, GMT+1
Tools: CCS 5.1, Windows 7, Navicat, Ultraedit
Local server: XAMPP with Apache, php and MySQL
Webserver: Windows 2008 IIS 7, php and MySQL
View profile  Send private message

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

PHP Reports

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.