Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery

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


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 all is quiet...

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (10)
As of 2018-06-25 16:19 GMT
Find Nodes?
    Voting Booth?
    Should cpanminus be part of the standard Perl release?

    Results (127 votes). Check out past polls.