Forum Moderators: coopster
My question, i have a form that gives me the path for the file to be uploaded that is it returns
C:\Documents and Settings\D\Desktop\file.jpg
now that i have the path i want to upload the file using FTP. I make the connection and everything works perfect in that area but my script doesn't upload. This is the part of script i'm having problem with i think.
... FTP Login code ...
$dest="temp.jpg";
$sourcefile= "C:\Documents and Settings\D\Desktop\file.jpg";
$upload=ftp_put($conn_id,$dest,$sourcefile,FTP_BINARY);
...
Is this the right way to put the paths?
thank you
ftp_put is for you to FTP a file on your server to another FTP site.
Check this for PHP Handling file uploads:
[us2.php.net...]
So is the conclusion that a file transfer from the local computer to the remote webserver cannot be achieved by using FTP? or should the local computer have some kind of FTP server running.
THnks again
If you want to pull a file from an end user and transfer it to your server following the link above is the way you're supposed to go.
ftp_put, like NickCoons said is for your SERVER to FTP into another FTP site.
A good example of this is the blogger service. If you don't have your blog hosted on their blogspot.com service, you can fill out your FTP information and have your blog published on your site.
The way this works is the user writes their post, it is stored on blogger's server, and the blogger program FTPs the files generated to the server you specify, updating your site.