Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Uploading File Problems

by kidd (Curate)
on Nov 19, 2002 at 19:55 UTC ( [id://214237]=perlquestion: print w/replies, xml ) Need Help??

kidd has asked for the wisdom of the Perl Monks concerning the following question:

Hello Monks:

I have a little script that lets users upload files to my server. My server is currently running in an UNIX OS.

The problem is that when a user with Windows OS has a file name or route the the file name with spaces, when uploading to the server it doesnt upload anything.

i.e.

c:/my documents/my image.jpg

Right now I had to set up a Javascript in the form that ckecks if there is any space in the file name or the route.

The thing is that I would like to be able to let them upload the files even with spaces...but I dont know how...

Hope that I can hear suggestions from you...

THANKS

Replies are listed 'Best First'.
Re: Uploading File Problems
by Ovid (Cardinal) on Nov 19, 2002 at 20:19 UTC

    Show us your Perl code (a minimal test case, if possible) and the HTML form tag. With that, we can probably provide you with a better answer.

    Cheers,
    Ovid

    New address of my CGI Course.
    Silence is Evil (feel free to copy and distribute widely - note copyright text)

Re: Uploading File Problems
by gjb (Vicar) on Nov 19, 2002 at 20:08 UTC

    It might help to change spaces to %20, ie. hex value for space.

    Hope this helps, -gjb-

      You should implement this using the module URI::Escape.

      Update: I R silly... thanks to UnderMine for pointing that out. Forget what I said.

      -nuffin
      zz zZ Z Z #!perl
        Arn't these spaces that need replacing on the client not the server?

        Hope it helps
        UnderMine

Re: Uploading File Problems
by UnderMine (Friar) on Nov 19, 2002 at 21:12 UTC
    A quick question

    Can you confirm whether the script is receiving the file but can't store it or it just does not recieve the file at all.

    If you are receiving the file but it is not possible to save it $filename=~s/\s/_/g; or even just use a $filename='lastupload.data'; to see if it is the spaces in the filename on the server that are causing the issue.

    Hope this helps
    UnderMine

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (3)
As of 2024-03-19 07:53 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found