View Full Version : Upload file, problem with the sign

06-17-2005, 10: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?

06-17-2005, 12:37 PM
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:

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

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.