Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re: CGI upload script problem with Explorer.

by Ieronim (Friar)
on Jul 25, 2006 at 17:53 UTC ( [id://563598]=note: print w/replies, xml ) Need Help??


in reply to CGI upload script problem with Explorer.

Generally it is a very bad idea to create a file basing on the name received from the upload field. If the possibility of overwriting files with 'same names' is necessary, i'd create a DBM file with names of uploaded files as keys and names of files on the server as values. The names of files on server could be e.g. generated with File::Temp. And you can add any extra logic on the stage of creating new keys in DB.

     s;;Just-me-not-h-Ni-m-P-Ni-lm-I-ar-O-Ni;;tr?IerONim-?HAcker ?d;print

Replies are listed 'Best First'.
Re^2: CGI upload script problem with Explorer.
by jdtoronto (Prior) on Jul 25, 2006 at 20:40 UTC
    eric256 & Ieronim,

    Your point is well taken, this is an internal application residing on an intranet or available through a VPN. It is essentially a highly specialised content manager that gets a whole lot of input from the user and packages up TAR files to be uploaded from my app server to a staging server in an IBM/Webshpere/Java environment. We need to have continuity of names from the designers desktop all the way through production. I do, however, appreciate the suggestions. Thank you!

    jdtoronto

      So, if you are sure that your users won't put any funny characters in their filenames, just remove the caret character from the regex in your code. Different browsers set differen names for uploaded files, but all of them include the base name. If i'm not mistaken, [\w-.] cannot be a path separator on any system.

           s;;Just-me-not-h-Ni-m-P-Ni-lm-I-ar-O-Ni;;tr?IerONim-?HAcker ?d;print

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://563598]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others exploiting the Monastery: (6)
As of 2024-04-23 13:52 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found