...

View Full Version : Upload file, problem with the sign



90January
06-17-2005, 09:11 AM
I have a problem with uploading the file.

The file name is "I don't know why.htm".

When I get the file name is "t know why.htm", but what I want is "I don't know why.htm". The problem is (') sign.

Could anybody help me?

maltrecho
06-17-2005, 11:37 AM
It's all about security. You could try with javascript. I've never done it but the process should be:

Get the path of the file with the real name:



<form...>
<input type="file" name="new_file" onchange="javascript:document.form.file_path.value=this.value;">
<input type="hidden" name="file_path" value="">
<form>


Now, on submit, you get the real path and name of the file, process it with basename() or whowever to get the original name.

Upload the file and rename it to the original one.

Hope it helps.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum