Hello and welcome to our community! Is this your first visit?
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    May 2005
    Thanked 0 Times in 0 Posts

    Question Upload file, problem with the sign

    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?

  • #2
    Regular Coder
    Join Date
    Feb 2003
    Thanked 0 Times in 0 Posts
    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.


    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts