How to use php ftp upload script?

Asked By 10 points N/A Posted on -
qa-featured

Hello Guys,

How to use PHP FTP upload script? There are some instances that we need to have a video tutorial or any website that can give us the full and exact information needed to learn some IT related topics such as programming languages which are not that easy that is why I am asking your opinions regarding this issue,

Thank you.

SHARE
Answered By 0 points N/A #187655

How to use php ftp upload script?

qa-featured
There is a way to upload PHP using FTP!
 
 
/ / Create the connection
$ conn_id = ftp_connect ("ftp.truc.bidule");
/ / Login with username and password account
$ login_result = ftp_login ($ conn_id, $ username, $ password);
ftp_pasv ($ conn_id, TRUE);
/ / Check connection
if ((! $ conn_id) | | (! $ login_result)) {
echo "FTP connection has failed!";
/ / Echo "Attempted to connect to $ ftp_server $ ftp_user_name";
die;
Else {}
echo "Connected to remote server <br />";
}
/ / Upload a file
$ upload = ftp_put ($ conn_id, $ tonfichierdepart, $ tonfichierarrivee, FTP_BINARY);
/ / Check upload
if ($ upload) {
echo "The download failed Ftp!";
Else {}
echo "Uploaded $ img on remote server";
}
/ / Close the FTP connection.
ftp_quit ($ conn_id);
 
 
Of course, put all this AFTER processing a form using file upload!
 
Pay attention to the limits set by your host!
 

To download it, you really must read on php.net, for PHP can help you!

 

Related Questions