Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask

Uploading File Problems

by kidd (Curate)
on Nov 19, 2002 at 19:55 UTC ( #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.


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...


Comment on Uploading File Problems
Download Code
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.


    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.

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

        Hope it helps

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=''; to see if it is the spaces in the filename on the server that are causing the issue.

    Hope this helps

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (7)
As of 2015-11-27 21:50 GMT
Find Nodes?
    Voting Booth?

    What would be the most significant thing to happen if a rope (or wire) tied the Earth and the Moon together?

    Results (734 votes), past polls