|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
||||
|
||||
|
Net::FTP Question
i am trying to get a file but anything with a space in it gives me an error:
$fn = "blah bla"; $ftp->get("$fn","path"); will say 'Bad file name' i read that the newer Net::FTP module gets around this, however does anyone have any ideas on how to get around this without installing the new module(also, rename is not an option since i don't have write access)? thanks! ![]() |
|
#2
|
|||
|
|||
|
The problem is probably because Net::FTP just sends "@_" to the server, try this on $fn:
Code:
$fn =~ s/[^a-z0-9]/\\$1/g; You might find that if you do that, and then a new Net::FTP gets installed, it will then be double-slashed out (which would be bad). You could just check the Net::FTP version before you do that regex there though, to make sure it needs to be done. [edit] replaced $fh with $fn ;p
__________________
Jon Coulter ledjon@ledjon.com Last edited by JonLed : June 26th, 2002 at 02:05 PM. |
|
#3
|
|||
|
|||
|
Just a guess - but put a %20 and see what happens!
|
|
#4
|
|||
|
|||
|
I'm pretty sure if you just get rid of the double quotes for single quotes it will work fine
$fn = 'some file'; -Chris |
|
#5
|
||||
|
||||
|
thanks for the replies...none worked however i figured out a way around it by just using a shell script to ftp when a space was encountered
|
![]() |
| Viewing: Dev Shed Forums > System Administration > FTP Help > Net::FTP Question |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|