egorig Posted March 1, 2008 Share Posted March 1, 2008 Hi everyone, in index.php i'm calling a function this way : Uploading Archived Filename <?php upload_to_server($archive_filename);?> : <b>Done</b> <br/> here's the function upload_to_server() [pre] function upload_to_server($fname) { $ftp = ftp_connect(FTP_SERVER) or die('Could not connect to FTP'); @ftp_login($ftp,FTP_USERNAME,FTP_PASSWORD) or die('Wrong username or password!'); ftp_put($ftp, $fname, $fname, FTP_BINARY) or die('Error while uploading file to the server'); ftp_close($ftp); } [/pre] The page says "Transfering .." till one time and then it says Done (in Firefox). But the file is still uploading (i'm checking that with FTP Client and on Refresh it changes its size) and the message <b>Done</b> is not displayed , so the other part of the page (footer ..). I tried this : set_time_limit(0); ftp_nb_put(); ftp_set_option($ftp, FTP_TIMEOUT_SEC, 10000); return true (at the end of the function) but they don't help. Can anyone tell me why is this happening ? Thanx in advance! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.