Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine

Re: How to upload file without using FTP?

by roboticus (Chancellor)
on May 24, 2006 at 11:39 UTC ( #551335=note: print w/ replies, xml ) Need Help??

in reply to How to upload file without using FTP?


A couple of things: First, in the code you've shown, you've forgotten to set $upload_dir, so your open may be failing because of that. Secondly, your regular expression is missing a character. I think you meant this:

But after seeing what you're doing, I'd simplify and rearrange the filename parsing bit to look like this:

my ($drive, $path, $file); die "Invalid file name!" unless $file_query1 =~ /(\w:)?(.+)[\\\/](.*)/; print "Drive=", $1, ", Path=", $2, ", File=", $3, "\n";
In any case, I'd second McDarren's suggestion. I've used Net::FTP and it works nicely for jobs like this.


Comment on Re: How to upload file without using FTP?
Select or Download Code
Replies are listed 'Best First'.
Re^2: How to upload file without using FTP?
by davidrw (Prior) on May 24, 2006 at 13:01 UTC

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (3)
As of 2015-11-29 03:06 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 (746 votes), past polls