Parsing user input for a filename

Results 1 to 2 of 2

Thread: Parsing user input for a filename

  1. #1
    Join Date
    Dec 1969

    Default Parsing user input for a filename

    Here's the deal: I'm allowing users to create text files in a certain directory. I'm not looking for an upload script. The user is allowed to enter the filename through a form, then the extension .txt is appended to it (to prevent uploading of .asp or such). Bad People wouldn't normally get access this, but I want to make things reasonably tight in case they do. Is there standardized way to parse out weird characters? Obviously I want to get rid of stuff like ".." "/" "\" but I know that it's possible to create files with unprintable ascii characters. Any help or guidance would be appreciated.

  2. #2
    Join Date
    Dec 1969

    Default Krank

    Do a little R&D on regular expressions, esentially define list of characters that are allowable snd test the filename against it.

Posting Permissions

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