FTP Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsSystem AdministrationFTP Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old June 26th, 2002, 11:40 AM
tron's Avatar
tron tron is offline
SwollenMember
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2000
Location: the master control
Posts: 243 tron User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 4 h 36 m 22 sec
Reputation Power: 9
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!

Reply With Quote
  #2  
Old June 26th, 2002, 01:59 PM
JonLed JonLed is offline
Contributing User
Dev Shed Novice (500 - 999 posts)
 
Join Date: Aug 2000
Location: Indiana
Posts: 614 JonLed User rank is Corporal (100 - 500 Reputation Level)JonLed User rank is Corporal (100 - 500 Reputation Level)JonLed User rank is Corporal (100 - 500 Reputation Level)JonLed User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 4 h 49 m 49 sec
Reputation Power: 10
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.

Reply With Quote
  #3  
Old June 26th, 2002, 02:00 PM
RandyL712 RandyL712 is offline
Contributing User
Dev Shed Novice (500 - 999 posts)
 
Join Date: Feb 2002
Posts: 548 RandyL712 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 34 m 19 sec
Reputation Power: 0
Just a guess - but put a %20 and see what happens!

Reply With Quote
  #4  
Old June 26th, 2002, 04:54 PM
ChrisF ChrisF is offline
Senior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2002
Location: U.S. Mass
Posts: 95 ChrisF User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
I'm pretty sure if you just get rid of the double quotes for single quotes it will work fine

$fn = 'some file';

-Chris

Reply With Quote
  #5  
Old June 27th, 2002, 09:31 AM
tron's Avatar
tron tron is offline
SwollenMember
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2000
Location: the master control
Posts: 243 tron User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 4 h 36 m 22 sec
Reputation Power: 9
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

Reply With Quote
Reply

Viewing: Dev Shed ForumsSystem AdministrationFTP Help > Net::FTP Question


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway
Stay green...Green IT