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 December 18th, 2002, 02:17 PM
TheRealRodzilla TheRealRodzilla is offline
PHP Geek
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2002
Posts: 37 TheRealRodzilla User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 16 sec
Reputation Power: 7
Send a message via ICQ to TheRealRodzilla
Problem with FTP Transfer

I have a script I'm using for my file system which opens a remote file, opens an FTP connection to a server, and uploads the file to the FTP server. This works fine, unless there's a big file. The problem is that with a big file, it takes longer to transfer it. When the transfer passes a certain point(I'm not sure how long it is), it restarts. For example, if it's transferring a 50 MB file to the server, it'll be doing just fine until around 12-13 MB and then I'll refresh the FTP and it'll be at 1 MB, until it does it again. Here's the code:

PHP Code:
 $fp fopen($url"r");
if(!
$fp)
    
ErrorExit("Could not open file!");

// ...

DebugPrint("Now uploading to $path");
set_time_limit(1800); // 1800s = 30min
$beforetime getmicrotime();
DebugPrint("Resource ID of FTP conn is $conn");
DebugPrint("Resource ID of file itself is $fp");
$status ftp_fput($conn$path$fpFTP_BINARY);
$aftertime getmicrotime(); 


Any ideas?

Reply With Quote
  #2  
Old December 18th, 2002, 03:02 PM
maytricks's Avatar
maytricks maytricks is offline
Always Spell Chek
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2002
Location: NJ, USA
Posts: 338 maytricks User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 58 m 27 sec
Reputation Power: 7
About how much time would say between when you start the download and when it crashes?
__________________
Programming is easy. It's the thinking that's hard.

Search the forums before you ask your question.
PHP | MySQL websites. Visit them, read them, cherish them.
Read the posting rules, before you post.
See if your question has been answered already.

Reply With Quote
  #3  
Old December 18th, 2002, 03:07 PM
kicken's Avatar
kicken kicken is offline
Wiser? Not exactly.
Dev Shed Specialist (4000 - 4499 posts)
 
Join Date: May 2001
Location: Ft Myers, FL
Posts: 4,174 kicken User rank is Colonel (50000 - 60000 Reputation Level)kicken User rank is Colonel (50000 - 60000 Reputation Level)kicken User rank is Colonel (50000 - 60000 Reputation Level)kicken User rank is Colonel (50000 - 60000 Reputation Level)kicken User rank is Colonel (50000 - 60000 Reputation Level)kicken User rank is Colonel (50000 - 60000 Reputation Level)kicken User rank is Colonel (50000 - 60000 Reputation Level)kicken User rank is Colonel (50000 - 60000 Reputation Level)kicken User rank is Colonel (50000 - 60000 Reputation Level)kicken User rank is Colonel (50000 - 60000 Reputation Level)kicken User rank is Colonel (50000 - 60000 Reputation Level)kicken User rank is Colonel (50000 - 60000 Reputation Level)  Folding Points: 117001 Folding Title: Super Ultimate Folder - Level 1Folding Points: 117001 Folding Title: Super Ultimate Folder - Level 1Folding Points: 117001 Folding Title: Super Ultimate Folder - Level 1Folding Points: 117001 Folding Title: Super Ultimate Folder - Level 1Folding Points: 117001 Folding Title: Super Ultimate Folder - Level 1Folding Points: 117001 Folding Title: Super Ultimate Folder - Level 1
Time spent in forums: 1 Month 3 Weeks 38 m 49 sec
Reputation Power: 563
Send a message via ICQ to kicken Send a message via AIM to kicken Send a message via MSN to kicken
Try local

Might try saving the URL to a local tmp file and then use ftp_put to upload that.

Reply With Quote
  #4  
Old December 18th, 2002, 03:21 PM
TheRealRodzilla TheRealRodzilla is offline
PHP Geek
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2002
Posts: 37 TheRealRodzilla User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 16 sec
Reputation Power: 7
Send a message via ICQ to TheRealRodzilla
Quote:
Originally posted by maytricks
About how much time would say between when you start the download and when it crashes?


Maybe 5-10 minutes, closer to 5.

Reply With Quote
  #5  
Old December 18th, 2002, 03:27 PM
maytricks's Avatar
maytricks maytricks is offline
Always Spell Chek
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2002
Location: NJ, USA
Posts: 338 maytricks User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 58 m 27 sec
Reputation Power: 7
Try using the IP address in the url and see if it happens. I seem to remember reading somewhere that ftp functions have a problem resolving hostnames.

Reply With Quote
  #6  
Old December 18th, 2002, 03:33 PM
TheRealRodzilla TheRealRodzilla is offline
PHP Geek
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2002
Posts: 37 TheRealRodzilla User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 16 sec
Reputation Power: 7
Send a message via ICQ to TheRealRodzilla
The FTP function is using a file pointer, not an actual URL with hostnames. I can't use the IP because the webservers' domains and IPs are the exact same(typing in the IP does not give the same results as typing in the host name).

Reply With Quote
  #7  
Old December 27th, 2002, 01:43 PM
TheRealRodzilla TheRealRodzilla is offline
PHP Geek
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2002
Posts: 37 TheRealRodzilla User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 16 sec
Reputation Power: 7
Send a message via ICQ to TheRealRodzilla
*bump*

Reply With Quote
Reply

Viewing: Dev Shed ForumsSystem AdministrationFTP Help > Problem with FTP Transfer


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 4 hosted by Hostway
Stay green...Green IT