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
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() problem??
On 24/05/07, Al [EMAIL PROTECTED] wrote: Can anyone help with this. On a Linux/Apache server. I want to simply copy a file with ftp_put() from one dir to another. To make certain I'm pointing to the correct dirs, I'm using this: print_r(ftp_nlist($conn_id, FTP_EP_DIR)); //It is the correct dir print_r(ftp_nlist($conn_id, $rpdir)); //It is the correct dir Then I'm: ftp_put($conn_id, FTP_EP_DIR .'/' . $file, $rpdir. '/' . $file, FTP_ASCII); Error msg: Warning: ftp_put(/home/x/public_html/test/EditPageIndexer.php) [ function.ftp-put]: failed to open stream: No such file or directory in /home/x/public_html/EditPage/ep_functions.inc on line 227 And the files are not copied. Owner and permissions are correct. I can make a new dir [mkdir()] in the destination dir without a problem. Manual is confusing when it calls the files remote and local. Thanks -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php Are you using the correct syntax? Make sure you are specifying the remote file first, then the local file. ftp_put($conn_id, $remote_file, $file, FTP_ASCII) -- Tom Chubb [EMAIL PROTECTED]
Re: [PHP] ftp_put and ftp_chmod does not work
When safe mode is enabled, PHP checks whether the files or directories you are about to operate on have the same UID (owner) as the script that is being executed. In addition, you cannot set the SUID, SGID and sticky bits. It means that the UID (owner) of the folder ought to be the apache user or the ftp user? Whoever owns the php script (which would be the ftp user). They need to match exactly (same user, same group). You can relax safe-mode to check the same groups (http://www.php.net/manual/en/features.safe-mode.php#ini.safe-mode-gid) rather than the same user group but that's up to the server admin / host. move_uploaded_file will always fail because the file isn't uploaded through a form. The documentation makes this rather clear (see also is_uploaded_file). The file realy was uploaded by a form and it is in the temporary upload folder of php. I misunderstood then. -- 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 and ftp_chmod does not work
Chris [EMAIL PROTECTED] escreveu na mensagem news:[EMAIL PROTECTED] João Cândido de Souza Neto wrote: Hello everyone. I have got some parts of my system where some files are sent and i use ftp functions to save suche files. When i run it in my local machine, it works fine but, when it is on the server i got some errors. I was using ftp_put to copy such files from upload_temp folder of php to my system own folder and it does not work, i thought it could be because the ftp user has no permission in upload_temp folder of php. Most likely. ftp users are usually locked in to their own home folders and can't access any other parts of the system. It's simply a security thing. I agree. Then i tried to use php_chmod to give permissions for the apache user, move_uploaded_files to move such file and ftp_chmod agais to remove permissions. It does not work too, i think it is because the server has safe_mode on. chmod will be affected by safe mode (please read the documentation): When safe mode is enabled, PHP checks whether the files or directories you are about to operate on have the same UID (owner) as the script that is being executed. In addition, you cannot set the SUID, SGID and sticky bits. It means that the UID (owner) of the folder ought to be the apache user or the ftp user? move_uploaded_file will always fail because the file isn't uploaded through a form. The documentation makes this rather clear (see also is_uploaded_file). The file realy was uploaded by a form and it is in the temporary upload folder of php. -- 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 and ftp_chmod does not work
João Cândido de Souza Neto wrote: Hello everyone. I have got some parts of my system where some files are sent and i use ftp functions to save suche files. When i run it in my local machine, it works fine but, when it is on the server i got some errors. I was using ftp_put to copy such files from upload_temp folder of php to my system own folder and it does not work, i thought it could be because the ftp user has no permission in upload_temp folder of php. Most likely. ftp users are usually locked in to their own home folders and can't access any other parts of the system. It's simply a security thing. Then i tried to use php_chmod to give permissions for the apache user, move_uploaded_files to move such file and ftp_chmod agais to remove permissions. It does not work too, i think it is because the server has safe_mode on. chmod will be affected by safe mode (please read the documentation): When safe mode is enabled, PHP checks whether the files or directories you are about to operate on have the same UID (owner) as the script that is being executed. In addition, you cannot set the SUID, SGID and sticky bits. move_uploaded_file will always fail because the file isn't uploaded through a form. The documentation makes this rather clear (see also is_uploaded_file). -- 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 and ftp_chmod does not work
On Fri, October 6, 2006 3:32 pm, João Cândido de Souza Neto wrote: when it is on the server i got some errors. If you tell us what errors, you change the problem from an infinitely large set of what could go wrong, to a rather small set of what probably went wrong... -- Some people have a gift link here. Know what I want? I want you to buy a CD from some starving artist. http://cdbaby.com/browse/from/lynch Yeah, I get a buck. So? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] ftp_put and ftp_chmod does not work
In both case the functions just returns false. Richard Lynch [EMAIL PROTECTED] escreveu na mensagem news:[EMAIL PROTECTED] On Fri, October 6, 2006 3:32 pm, João Cândido de Souza Neto wrote: when it is on the server i got some errors. If you tell us what errors, you change the problem from an infinitely large set of what could go wrong, to a rather small set of what probably went wrong... -- Some people have a gift link here. Know what I want? I want you to buy a CD from some starving artist. http://cdbaby.com/browse/from/lynch Yeah, I get a buck. So? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] [SOLVED] Re: [PHP] ftp_put()'ing a string ...
I figured out how to ftp a string into a remote file using the ftp streams wrappers. the code looks as follows (I leave out the definition of the [error logging] callback PLFTPServerNotifier() the prototype requirements of which can be found in the manual): ?php $context = stream_context_create(array('ftp' = array('overwrite' = false))); stream_context_set_params($context, array('notification' = 'PLFTPServerNotifier')); $retval = file_put_contents(ftp://{$ftp_user}:[EMAIL PROTECTED]:21/{$filename}, $xml, 0, $context); ? turns out my upload function is 3 lines long - pretty cool stuff this streams functionality :-) Jochem Maas wrote: hi everyone, I was wondering if anyone knew how (if possible) I could take a string and ftp_put()/ftp_fput() that string directly onto the remote server as a file (without first saving the string to disk temporarily locally) I imagine that there is a way to create a stream that refers to the string in question but I can't get my head round the streams functionality... Obviously saving the string temporarily to disk locally is an easy option but I was kind of using the situation I have now to try and do something a little fancy and learn something about streams. anyone with idea/pointers? TIA, Jochem. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] ftp_put and ftp_fput both failing me
Wayne Zeller wrote: Marek Kilimajer wrote: 30 seconds? This must be your firewall blocking connections from outside world. Use ftp_pasv() to turn on passive mode. That did the trick. Thanks s much! Marek shoots, Marek scores :-) Wayne -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] ftp_put and ftp_fput both failing me
Wayne Zeller wrote: My first attempt at posting this appears to have failed, so I'll try again. My apologies if this is a duplicate... I can't for the life of me figure out why this won't work. I am downloading a file from a remote host via ftp, processing it and modifying part of it, and then uploading the updated file back to the remote server via ftp. Everything is working great until it comes time to put the modified file back onto the remote host. The script successfully logs in, but fails to put the file. I want the final file to overwrite the original, but it fails even if I give it a new name so as to not overwrite. So overwriting isn't the problem. Here is the section of code I'm using: // I'm putting my contents into $myfile: $myfile = 'A bunch of text. (An html file, actually.)'; // Setting up connection parameters: $ftp_server = 'www.myserver.com'; $ftp_user_name = 'myusername'; $ftp_user_pass = 'mypassword'; $remote_file_name = 'filename.htm'; // Create a tmp file: $fp = tmpfile(); fwrite($fp, $myfile); rewind($fp); // Log into the remote server: $conn_id = ftp_connect($ftp_server); $login_result = ftp_login($conn_id, $ftp_user_name, $ftp_user_pass); if ((!$conn_id) || (!$login_result)) { echo FTP connection has failed!; echo Attempted connection to $ftp_server for $ftp_user_name; exit; } else { echo Connected to $ftp_server, for user $ftp_user_name.; } // EVERYTHING WORKS FINE UP TO HERE // upload the file: $upload = ftp_put($conn_id, $remote_file_name, $fp, FTP_ASCII); //FAILS! // check upload status if (!$upload) { echo FTP upload has failed! $upload; //THIS IS THE OUTPUT I GET } else { echo Uploaded $source_file to $ftp_server as $destination_file; } // close the FTP stream ftp_close($conn_id); When I run the program, it returns Connected to (servername), for user (username).FTP upload has failed! Sure enough, when checking on the remote server, the file has not been touched. I've tried using a file handle and using ftp_fput, but I get the same results. You must use ftp_fput() because you are using open file handle. Check that tmpfile() did not fail. Then make sure you are in the right directory after logging in the ftp server. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] ftp_put and ftp_fput both failing me
Marek Kilimajer wrote: You must use ftp_fput() because you are using open file handle. Check that tmpfile() did not fail. Then make sure you are in the right directory after logging in the ftp server. That's what I get for trying to put together code for my post during attempts to do it several different ways. I ended up posting code that was a hybrid of when I tried it using the file name with ftp_put and when I used a file handle with ftp_fput. The exact same code that I posted, but with ftp_fput instead of ftp_put gives the same results. The script takes about 30 seconds to run, and then reports its failure. I've verified that the temp file is being created with the correct contents. Getting this to work is pretty key for a project I'm working on, so if there's another way to do it, even if it's a harder way, I'm totally open to any suggestions. :) Wayne -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] ftp_put and ftp_fput both failing me
Wayne Zeller wrote: Marek Kilimajer wrote: You must use ftp_fput() because you are using open file handle. Check that tmpfile() did not fail. Then make sure you are in the right directory after logging in the ftp server. That's what I get for trying to put together code for my post during attempts to do it several different ways. I ended up posting code that was a hybrid of when I tried it using the file name with ftp_put and when I used a file handle with ftp_fput. The exact same code that I posted, but with ftp_fput instead of ftp_put gives the same results. The script takes about 30 seconds to run, and then reports its failure. I've verified that the temp file is being created with the correct contents. 30 seconds? This must be your firewall blocking connections from outside world. Use ftp_pasv() to turn on passive mode. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] ftp_put and ftp_fput both failing me
Marek Kilimajer wrote: 30 seconds? This must be your firewall blocking connections from outside world. Use ftp_pasv() to turn on passive mode. That did the trick. Thanks s much! Wayne -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] ftp_put() problem
On Thursday 16 December 2004 00:54, Lowell Allen wrote: But trying to avoid writing to the local server by using ftp_put() instead, this does not work: My manual says ftp_put() - Uploads a file to the FTP server And no, I can't find any command to upload a string in memory as a file. If you have a recent version of PHP you could use the regular filesystem functions to write 'directly' to an FP server. -- Jason Wong - Gremlins Associates - www.gremlins.biz Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * -- Search the list archives before you post http://marc.theaimsgroup.com/?l=php-general -- /* Man will never fly. Space travel is merely a dream. All aspirin is alike. */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] FTP_PUT 0kb problem
jpb wrote: I am using the FTP_PUT command in conjunction with a form: form action=upload.php method=post enctype=multipart/form-data input type=file name=imagefile input type=submit value=Submit upload.php: Everything seems to work except the put statement. $upload = ftp_put($conn_id, $destination_file, $_POST[imagefile], FTP_BINARY); I am connecting to the server and it is replacing the old image file with a 0 kb file. Permissions are RWX across the board. Any ideas? Read http://www.php.net/manual/en/features.file-upload.php information about uploaded file(s) is in $_FILES array and $_FILES['imagefile'] is an array -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] ftp_put Problems
Julian wrote: Hello, I need to use FTP to upload a local file to a server. The uploads must be done through FTP and not HTTP. Unfortunately, the example in the manual is not working for me. If someone has any suggestions I would really appreciate it. Not much information. There is not error checking in the example, try this and tell us the output: $file = 'somefile.txt'; $remote_file = 'readme.txt'; // set up basic connection $conn_id = ftp_connect($ftp_server); if(!$conn_id) die(Could not open connection to $ftp_server); // login with username and password $login_result = ftp_login($conn_id, $ftp_user_name, $ftp_user_pass); if(!$login_result) die(Could not login as user $ftp_user_name); // upload a file if (ftp_put($conn_id, $remote_file, $file, FTP_ASCII)) { echo successfully uploaded $file\n; } else { echo There was a problem while uploading $file\n; } // close the connection ftp_close($conn_id); -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] ftp_put Problems
Maybe I should be more specific about what I am trying to do. I may be way off base in my approach. I want to upload using ftp a file from my local c drive (c:\somefile.text) to my server. I have been trying the ftp_put function example in the manual and it is failing. It reports There was a problem uploading the file. Any suggestions would be greatly appreciated. Thanks, Julian Marek Kilimajer [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Julian wrote: Hello, I need to use FTP to upload a local file to a server. The uploads must be done through FTP and not HTTP. Unfortunately, the example in the manual is not working for me. If someone has any suggestions I would really appreciate it. Not much information. There is not error checking in the example, try this and tell us the output: $file = 'somefile.txt'; $remote_file = 'readme.txt'; // set up basic connection $conn_id = ftp_connect($ftp_server); if(!$conn_id) die(Could not open connection to $ftp_server); // login with username and password $login_result = ftp_login($conn_id, $ftp_user_name, $ftp_user_pass); if(!$login_result) die(Could not login as user $ftp_user_name); // upload a file if (ftp_put($conn_id, $remote_file, $file, FTP_ASCII)) { echo successfully uploaded $file\n; } else { echo There was a problem while uploading $file\n; } // close the connection ftp_close($conn_id); -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] ftp_put Problems
On Sunday 26 September 2004 06:38, Julian wrote: Maybe I should be more specific about what I am trying to do. I may be way off base in my approach. I want to upload using ftp a file from my local c drive (c:\somefile.text) to my server. I have been trying the ftp_put function example in the manual and it is failing. It reports There was a problem uploading the file. If the script is running on the server then yes you're way off base. Remember the ftp_*() functions operate relative to where the script is running. What exactly is it you're trying to do? -- Jason Wong - Gremlins Associates - www.gremlins.biz Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * -- Search the list archives before you post http://marc.theaimsgroup.com/?l=php-general -- /* Laughter is the closest distance between two people. -- Victor Borge */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] ftp_put Problems
i am trying to get a file from my local c drive to my server using something other than a form. thanks, julian Jason Wong [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] On Sunday 26 September 2004 06:38, Julian wrote: Maybe I should be more specific about what I am trying to do. I may be way off base in my approach. I want to upload using ftp a file from my local c drive (c:\somefile.text) to my server. I have been trying the ftp_put function example in the manual and it is failing. It reports There was a problem uploading the file. If the script is running on the server then yes you're way off base. Remember the ftp_*() functions operate relative to where the script is running. What exactly is it you're trying to do? -- Jason Wong - Gremlins Associates - www.gremlins.biz Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * -- Search the list archives before you post http://marc.theaimsgroup.com/?l=php-general -- /* Laughter is the closest distance between two people. -- Victor Borge */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] ftp_put Problems
Julian wrote: i am trying to get a file from my local c drive to my server using something other than a form. Hmm, you can run an ftp server on your local machine and use php script on the server to retrieve the files. http server will work just as well. Is this what you want? thanks, julian Jason Wong [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] On Sunday 26 September 2004 06:38, Julian wrote: Maybe I should be more specific about what I am trying to do. I may be way off base in my approach. I want to upload using ftp a file from my local c drive (c:\somefile.text) to my server. I have been trying the ftp_put function example in the manual and it is failing. It reports There was a problem uploading the file. If the script is running on the server then yes you're way off base. Remember the ftp_*() functions operate relative to where the script is running. What exactly is it you're trying to do? -- Jason Wong - Gremlins Associates - www.gremlins.biz Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * -- Search the list archives before you post http://marc.theaimsgroup.com/?l=php-general -- /* Laughter is the closest distance between two people. -- Victor Borge */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] ftp_put Problems
well, i suspect i am at a dead end. here is the layout of things. we want to put up an internet kiosk at certain thoroughbred auctions to allow people to send ecards as well as contact associates. we have a web cam on the kiosk and a partner came up with the idea of letting them send photos of themselves as well. the problem is i cannot find a way to use the form type FILE without giving the user access to everything on the kiosk computer. try as i might i cannot get around that browse button. so i thought i would try the ftp functions which i am totally unfamiliar with. i do truly appreciate the time you and others took to look into this. julian Marek Kilimajer [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Julian wrote: i am trying to get a file from my local c drive to my server using something other than a form. Hmm, you can run an ftp server on your local machine and use php script on the server to retrieve the files. http server will work just as well. Is this what you want? thanks, julian Jason Wong [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] On Sunday 26 September 2004 06:38, Julian wrote: Maybe I should be more specific about what I am trying to do. I may be way off base in my approach. I want to upload using ftp a file from my local c drive (c:\somefile.text) to my server. I have been trying the ftp_put function example in the manual and it is failing. It reports There was a problem uploading the file. If the script is running on the server then yes you're way off base. Remember the ftp_*() functions operate relative to where the script is running. What exactly is it you're trying to do? -- Jason Wong - Gremlins Associates - www.gremlins.biz Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * -- Search the list archives before you post http://marc.theaimsgroup.com/?l=php-general -- /* Laughter is the closest distance between two people. -- Victor Borge */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] ftp_put Problems
Julian wrote: well, i suspect i am at a dead end. here is the layout of things. we want to put up an internet kiosk at certain thoroughbred auctions to allow people to send ecards as well as contact associates. we have a web cam on the kiosk and a partner came up with the idea of letting them send photos of themselves as well. the problem is i cannot find a way to use the form type FILE without giving the user access to everything on the kiosk computer. try as i might i cannot get around that browse button. so i thought i would try the ftp functions which i am totally unfamiliar with. i do truly appreciate the time you and others took to look into this. You can setup a apache and php on the kiosk machine. Document root will be the folder where the webcam stores images, or just one directory up. You can create a simple php script that will let them browse the pictures (only the pictures :)), or not so simple that will allow them to make some adjustments to the pictures using image functions. When everything is ready, with a press of a button then can mail the ecards. What would be done on the server will do the kiosk. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] ftp_put Problems
Julian wrote: i am trying to get a file from my local c drive to my server using something other than a form. This is pretty much an impossible task for server side scripting. You can perhaps use an applet to upload either via FTP or HTTP. but marek's last mail is probably the best solution. -- Raditha Dissanayake. http://www.radinks.com/sftp/ | http://www.raditha.com/megaupload Lean and mean Secure FTP applet with | Mega Upload - PHP file uploader Graphical User Inteface. Just 128 KB | with progress bar. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] FTP_PUT PROBLEMS
On Sunday 27 July 2003 10:22, Rausch Alexandru wrote: I have some problem with uploading a file from my harddisk using a ftp connection. Here are the 2 files: You don't upload local files using the ftp_*() functions. You follow the examples in manual Handling file uploads. -- Jason Wong - Gremlins Associates - www.gremlins.biz Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * -- Search the list archives before you post http://marc.theaimsgroup.com/?l=php-general -- /* Miller's Slogan: Lose a few, lose a few. */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] ftp_put: permission denied
Well, how to I get access to where I'm trying to put it? The rights already are 777. Olli Thomas Seifert schrieb: it may be, that destiny is wrong. the error-message tells that you don't have access to where you are trying to upload the file to. Thomas On Wed, 08 Jan 2003 20:59:02 +0100 [EMAIL PROTECTED] (Oliver Witt) wrote: I uploaded that script with a common ftp program on my server in the internet. FOr the host, user and pw, I use the same data as I use to log in with my ftp program. So the mistake can't be there. This is how that script basically works: ?php if(isset($destiny)){ $ftp_server = host; $benutzername = user; $passwort = pw; $connection_id = ftp_connect($ftp_server); $login_result = ftp_login($connection_id, $benutzername, $passwort); $upload = ftp_put($connection_id, $destiny, $local_file, FTP_ASCII); if (!$upload) { echo pIt didn't work/p;} else { echo pIt did work/p;} ftp_quit($connection_id);} ? html head title/title /head body bgcolor=#FF text=#00 form action=upload.php enctype=multipart/form-data method=POST input name=local_file type=file size=50 br input type=text name=destiny br input type=submit value=Submit /form /body /html Timothy Hitchens ) schrieb: Using ftp_login() ?? Timothy Hitchens (HiTCHO) Open Platform Consulting e-mail: [EMAIL PROTECTED] -Original Message- From: Oliver Witt [mailto:[EMAIL PROTECTED]] Sent: Thursday, 9 January 2003 5:30 AM To: [EMAIL PROTECTED]; Timothy Hitchens ) Subject: Re: [PHP] ftp_put: permission denied Timothy Hitchens ) schrieb: I am assuming you have testing from a desktop client. Are you sure that the PHP script has been logged in?? Can you see via a log file of the successful authentication?? I logged in using the same information as I used to upload that script. if ((!$conn_id) || (!$login_result)) { echo Not logged in; die; } else { echo Logged in; } That script returned Logged in. Olli -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] ftp_put: permission denied
I am assuming you have testing from a desktop client. Are you sure that the PHP script has been logged in?? Can you see via a log file of the successful authentication?? Timothy Hitchens (HiTCHO) Open Platform Consulting e-mail: [EMAIL PROTECTED] -Original Message- From: Oliver Witt [mailto:[EMAIL PROTECTED]] Sent: Thursday, 9 January 2003 4:53 AM To: [EMAIL PROTECTED] Subject: [PHP] ftp_put: permission denied Hi, I am running a really simple php script to upload files on my server via ftp. But it always return this warning: ftp_put(): Permission denied I can't have to do anything with CHMOD can it? I mean it's ftp!! I don't know what else it is but I guess it's a pretty common problem. Thx for any help, Olli -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] ftp_put: permission denied
Timothy Hitchens ) schrieb: I am assuming you have testing from a desktop client. Are you sure that the PHP script has been logged in?? Can you see via a log file of the successful authentication?? I logged in using the same information as I used to upload that script. if ((!$conn_id) || (!$login_result)) { echo Not logged in; die; } else { echo Logged in; } That script returned Logged in. Olli -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] ftp_put: permission denied
Using ftp_login() ?? Timothy Hitchens (HiTCHO) Open Platform Consulting e-mail: [EMAIL PROTECTED] -Original Message- From: Oliver Witt [mailto:[EMAIL PROTECTED]] Sent: Thursday, 9 January 2003 5:30 AM To: [EMAIL PROTECTED]; Timothy Hitchens ) Subject: Re: [PHP] ftp_put: permission denied Timothy Hitchens ) schrieb: I am assuming you have testing from a desktop client. Are you sure that the PHP script has been logged in?? Can you see via a log file of the successful authentication?? I logged in using the same information as I used to upload that script. if ((!$conn_id) || (!$login_result)) { echo Not logged in; die; } else { echo Logged in; } That script returned Logged in. Olli -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] ftp_put: permission denied
I uploaded that script with a common ftp program on my server in the internet. FOr the host, user and pw, I use the same data as I use to log in with my ftp program. So the mistake can't be there. This is how that script basically works: ?php if(isset($destiny)){ $ftp_server = host; $benutzername = user; $passwort = pw; $connection_id = ftp_connect($ftp_server); $login_result = ftp_login($connection_id, $benutzername, $passwort); $upload = ftp_put($connection_id, $destiny, $local_file, FTP_ASCII); if (!$upload) { echo pIt didn't work/p;} else { echo pIt did work/p;} ftp_quit($connection_id);} ? html head title/title /head body bgcolor=#FF text=#00 form action=upload.php enctype=multipart/form-data method=POST input name=local_file type=file size=50 br input type=text name=destiny br input type=submit value=Submit /form /body /html Timothy Hitchens ) schrieb: Using ftp_login() ?? Timothy Hitchens (HiTCHO) Open Platform Consulting e-mail: [EMAIL PROTECTED] -Original Message- From: Oliver Witt [mailto:[EMAIL PROTECTED]] Sent: Thursday, 9 January 2003 5:30 AM To: [EMAIL PROTECTED]; Timothy Hitchens ) Subject: Re: [PHP] ftp_put: permission denied Timothy Hitchens ) schrieb: I am assuming you have testing from a desktop client. Are you sure that the PHP script has been logged in?? Can you see via a log file of the successful authentication?? I logged in using the same information as I used to upload that script. if ((!$conn_id) || (!$login_result)) { echo Not logged in; die; } else { echo Logged in; } That script returned Logged in. Olli -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] ftp_put: permission denied
it may be, that destiny is wrong. the error-message tells that you don't have access to where you are trying to upload the file to. Thomas On Wed, 08 Jan 2003 20:59:02 +0100 [EMAIL PROTECTED] (Oliver Witt) wrote: I uploaded that script with a common ftp program on my server in the internet. FOr the host, user and pw, I use the same data as I use to log in with my ftp program. So the mistake can't be there. This is how that script basically works: ?php if(isset($destiny)){ $ftp_server = host; $benutzername = user; $passwort = pw; $connection_id = ftp_connect($ftp_server); $login_result = ftp_login($connection_id, $benutzername, $passwort); $upload = ftp_put($connection_id, $destiny, $local_file, FTP_ASCII); if (!$upload) { echo pIt didn't work/p;} else { echo pIt did work/p;} ftp_quit($connection_id);} ? html head title/title /head body bgcolor=#FF text=#00 form action=upload.php enctype=multipart/form-data method=POST input name=local_file type=file size=50 br input type=text name=destiny br input type=submit value=Submit /form /body /html Timothy Hitchens ) schrieb: Using ftp_login() ?? Timothy Hitchens (HiTCHO) Open Platform Consulting e-mail: [EMAIL PROTECTED] -Original Message- From: Oliver Witt [mailto:[EMAIL PROTECTED]] Sent: Thursday, 9 January 2003 5:30 AM To: [EMAIL PROTECTED]; Timothy Hitchens ) Subject: Re: [PHP] ftp_put: permission denied Timothy Hitchens ) schrieb: I am assuming you have testing from a desktop client. Are you sure that the PHP script has been logged in?? Can you see via a log file of the successful authentication?? I logged in using the same information as I used to upload that script. if ((!$conn_id) || (!$login_result)) { echo Not logged in; die; } else { echo Logged in; } That script returned Logged in. Olli -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] ftp_put
Well I'm having the same problem... no useful suggestions from ME yet. :) - Victor www.argilent.com -Original Message- From: Jason Romero [mailto:[EMAIL PROTECTED]] Sent: Tuesday, September 03, 2002 5:13 PM To: [EMAIL PROTECTED] Subject: [PHP] ftp_put I am having problems getting the ftp_put command to upload a file to an apache server i get this error Warning: error opening C:\\WINDOWS\\Desktop\\Jason\\jjmckay\\testaudio.mp3 in /home/virtual/site31/fst/var/www/html/clientadmin/mp3upload.php on line 32 here is the code $dest = /var/www/html/public/$user/; $upload = ftp_put($FTP, $dest, $source_file, FTP_BINARY); if ($upload) echo it worked; else echo it didnt work; the $source_file is pulled from a form on the previous page any suggestions? Jason Romero -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php __ Post your free ad now! http://personals.yahoo.ca -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] ftp_put
Ensure that the user that PHP is running as has permissions to read the file. --zak - Original Message - From: Jon A [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, May 21, 2001 10:36 AM Subject: [PHP] ftp_put Hi, all. I try to do a file upload using the ftp_put function, where the source file is a string from a browse field When I try to do the upload php says that there is an error opening the local file. Does any of you know how to solve this problem? thanks in advance, Jon A -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]