RE: [PHP] ftp_put issues
Hi, yeah ftp manually works just fine using the same login too. James -Original Message- From: Chris [mailto:dmag...@gmail.com] Sent: Wednesday, April 15, 2009 10:09 PM To: James Cc: php-general@lists.php.net Subject: Re: [PHP] ftp_put issues James wrote: Hi, I'm trying to upload a pdf file from a local drive to the server using a php routine. I've done it server to server before with no issues but this just keeps failing on me. This is the function I'm calling, it connects and logs in just fine, but it will not upload the file. The file I'm sending is just a 100k pdf file. If you do it manually does it work? Maybe the account is over quota. -- Postgresql php tutorials http://www.designmagick.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] ftp_put issues
On Thu, Apr 16, 2009 at 9:27 PM, James mli...@ichor-interactive.com wrote: Hi, yeah ftp manually works just fine using the same login too. James -Original Message- From: Chris [mailto:dmag...@gmail.com] Sent: Wednesday, April 15, 2009 10:09 PM To: James Cc: php-general@lists.php.net Subject: Re: [PHP] ftp_put issues James wrote: Hi, I'm trying to upload a pdf file from a local drive to the server using a php routine. I've done it server to server before with no issues but this just keeps failing on me. This is the function I'm calling, it connects and logs in just fine, but it will not upload the file. The file I'm sending is just a 100k pdf file. If you do it manually does it work? Maybe the account is over quota. -- Postgresql php tutorials http://www.designmagick.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php Just to be clear where are you running your ftpData function from? Your local computer? Where is the PDF file coming from? I hope from your local computer as well. How does your Source and Dest variables look like? Full paths? Have you tried your firewall? (Assuming both script and file is coming from local and your firewall is on whitelist mode.) Cheers -- http://www.lampadmins.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] ftp_put issues
The ftpData function and in fact all the php stuff is running online on my webserver. The pdf file is on my local machine, I'm trying to upload the local pdf file to the server using ftp. The dest variable I have tried with the full path: /var/www/html/Docs/DU/DU1.pdf And with just the DU1.pdf along with ftp_chdir. The local file path is being passed through a html form and consists of L:/mypdfs/testpdf.pdf I've disabled my firewall to try that to no avail. James -Original Message- From: j's php general [mailto:php-generals-php-dot-...@jhive.net] Sent: Thursday, April 16, 2009 10:07 AM To: James Cc: php-general@lists.php.net Subject: Re: [PHP] ftp_put issues On Thu, Apr 16, 2009 at 9:27 PM, James mli...@ichor-interactive.com wrote: Hi, yeah ftp manually works just fine using the same login too. James -Original Message- From: Chris [mailto:dmag...@gmail.com] Sent: Wednesday, April 15, 2009 10:09 PM To: James Cc: php-general@lists.php.net Subject: Re: [PHP] ftp_put issues James wrote: Hi, I'm trying to upload a pdf file from a local drive to the server using a php routine. I've done it server to server before with no issues but this just keeps failing on me. This is the function I'm calling, it connects and logs in just fine, but it will not upload the file. The file I'm sending is just a 100k pdf file. If you do it manually does it work? Maybe the account is over quota. -- Postgresql php tutorials http://www.designmagick.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php Just to be clear where are you running your ftpData function from? Your local computer? Where is the PDF file coming from? I hope from your local computer as well. How does your Source and Dest variables look like? Full paths? Have you tried your firewall? (Assuming both script and file is coming from local and your firewall is on whitelist mode.) Cheers -- http://www.lampadmins.com
Re: [PHP] ftp_put issues
On Thu, Apr 16, 2009 at 10:24 PM, James Hill ja...@ichor-interactive.com wrote: The ftpData function and in fact all the php stuff is running online on my webserver. The pdf file is on my local machine, I'm trying to upload the local pdf file to the server using ftp. The dest variable I have tried with the full path: /var/www/html/Docs/DU/DU1.pdf And with just the DU1.pdf along with ftp_chdir. The local file path is being passed through a html form and consists of L:/mypdfs/testpdf.pdf I've disabled my firewall to try that to no avail. James Just to be clear where are you running your ftpData function from? Your local computer? Where is the PDF file coming from? I hope from your local computer as well. How does your Source and Dest variables look like? Full paths? Have you tried your firewall? (Assuming both script and file is coming from local and your firewall is on whitelist mode.) Cheers -- http://www.lampadmins.com I think that explains your problem, in order to upload a file via FTP your FTP client GENERALLY must reside on the same computer as your client, in your case your FTP client sits remotely elsewhere (which is your PHP script) and your file is on your local computer. A simple HTTP file upload should fit your 100K file nicely. Cheers. -- http://www.lampadmins.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] ftp_put issues
Ah ok, I guess that would explain it. Thanks for your help :-) -Original Message- From: j's php general [mailto:php-generals-php-dot-...@jhive.net] Sent: Thursday, April 16, 2009 10:39 AM To: James Hill Cc: php-general@lists.php.net Subject: Re: [PHP] ftp_put issues On Thu, Apr 16, 2009 at 10:24 PM, James Hill ja...@ichor-interactive.com wrote: The ftpData function and in fact all the php stuff is running online on my webserver. The pdf file is on my local machine, I'm trying to upload the local pdf file to the server using ftp. The dest variable I have tried with the full path: /var/www/html/Docs/DU/DU1.pdf And with just the DU1.pdf along with ftp_chdir. The local file path is being passed through a html form and consists of L:/mypdfs/testpdf.pdf I've disabled my firewall to try that to no avail. James Just to be clear where are you running your ftpData function from? Your local computer? Where is the PDF file coming from? I hope from your local computer as well. How does your Source and Dest variables look like? Full paths? Have you tried your firewall? (Assuming both script and file is coming from local and your firewall is on whitelist mode.) Cheers -- http://www.lampadmins.com I think that explains your problem, in order to upload a file via FTP your FTP client GENERALLY must reside on the same computer as your client, in your case your FTP client sits remotely elsewhere (which is your PHP script) and your file is on your local computer. A simple HTTP file upload should fit your 100K file nicely. Cheers. -- http://www.lampadmins.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] ftp_put issues
Hi, I'm trying to upload a pdf file from a local drive to the server using a php routine. I've done it server to server before with no issues but this just keeps failing on me. This is the function I'm calling, it connects and logs in just fine, but it will not upload the file. The file I'm sending is just a 100k pdf file. I have php set up with: max_execution_time = 30 max_input_time = 60 memory_limit = 20M file_uploads = On upload_max_filesize = 8M ftpData($fileField, /var/www/html/Docs/DU/DU1.pdf) with $filefield just being a local path taken from a filebrowser in a html form. I've also tried using ftp_chdir to change the destination path and when calling ftp_pwd is shows the current directory has changed to the correct one but it still won't write anything down. any ideas? James function ftpData($Source, $Dest){ // set up basic connection $success = 1; $ftp_server = blahblahbla.com; $ftp_user_name = dummy; $ftp_user_pass = dammy; $destination_file = $Dest; $source_file = $Source; $conn_id = ftp_connect($ftp_server); // login with username and password $login_result = ftp_login($conn_id, $ftp_user_name, $ftp_user_pass); // check connection if ((!$conn_id) || (!$login_result)) { echo FTP connection has failed!br; echo Attempted to connect to $ftp_server for user $ftp_user_namebr; $success = 0; exit; } else { echo Connected to $ftp_server, for user $ftp_user_namebr; } // upload the file $upload = ftp_put($conn_id, $destination_file, $source_file, FTP_BINARY); // check upload status if (!$upload) { echo FTP upload has failed!br; $success = 0; } else { echo Uploaded $source_file to $ftp_server as $destination_filebr; } // close the FTP stream ftp_close($conn_id); return($success); } -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] ftp_put issues
James wrote: Hi, I'm trying to upload a pdf file from a local drive to the server using a php routine. I've done it server to server before with no issues but this just keeps failing on me. This is the function I'm calling, it connects and logs in just fine, but it will not upload the file. The file I'm sending is just a 100k pdf file. If you do it manually does it work? Maybe the account is over quota. -- Postgresql php tutorials http://www.designmagick.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php