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:
Get inside! Sample the range of functionality easily built with JMSL Library for Time Series Data Analysis, Heat Maps, Portfolio Optimization, Monte Carlo Simulation, Stock Price Charting and more. Download Now!
  #1  
Old September 22nd, 2003, 05:25 PM
zchaos zchaos is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Posts: 4 zchaos User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via AIM to zchaos
FTP with PHP

Any good script already out there?

This has been tried before:

Code:

<?php function ftp( $ftp_server, $ftp_user_name,
$ftp_user_pass, $destination_file, $source_file ) { $fp =
fsockopen( "$ftp_server", 21, $errno, $errstr, 60 ); if ( !$fp ) {
print "Connection failed: $errstr ($errno)";
exit;
}
else {
socket_set_blocking( $fp, true );
print '<b>FTP transaction:</b><br />';
print fgets( $fp, 255 )."<br />";
fputs( $fp, "USER $ftp_user_name\r\n" );
print fgets( $fp, 255 )."<br />";
fputs( $fp, "PASS $ftp_user_pass\r\n" );
print fgets( $fp, 255 )."<br />";
// works up to here
fputs( $fp, "CWD files\r\n" );
print fgets( $fp, 255 )."<br />";
fputs( $fp, "TYPE A\r\n" );
print fgets( $fp, 255 )."<br />";
fputs( $fp, "PASV\r\n" );
print fgets( $fp, 255 )."<br />";
fputs( $fp, "STOR $source_file\r\n" );
print fgets( $fp, 255 )."<br />";
fputs( $fp, "QUIT\r\n" );
print fgets( $fp, 255 )."<br />";
fclose( $fp );
print 'Success';
/*
*/
}
}
?>

Fails at execution of upload...

Reply With Quote
  #2  
Old September 22nd, 2003, 06:03 PM
Nothsa Nothsa is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2003
Posts: 162 Nothsa User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 13 h 31 m 44 sec
Reputation Power: 6
fails how? doesn't upload? gives you an error msg? ... ?

Reply With Quote
  #3  
Old September 22nd, 2003, 06:09 PM
zchaos zchaos is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Posts: 4 zchaos User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via AIM to zchaos
FTP transaction:
220 renown FTP server (CH/1.9) ready.
331 Password required for admin%financialnewsusa.com.
230 User admin logged in.
250 CWD command successful.
200 Type set to A.
227 Entering Passive Mode (207,155,248,63,195,80)

and then:

Fatal error: Maximum execution time of 30 seconds exceeded

Reply With Quote
  #4  
Old September 22nd, 2003, 06:11 PM
Nothsa Nothsa is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2003
Posts: 162 Nothsa User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 13 h 31 m 44 sec
Reputation Power: 6
Your script is timing out before it can finish the upload. Try adding this to the top of your script:

PHP Code:
 set_time_limit(0

Reply With Quote
Reply

Viewing: Dev Shed ForumsSystem AdministrationFTP Help > FTP with PHP


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 2 hosted by Hostway