Top

Secure File Copy using FTP through HTTP


PHP Code
+ 0 likes
Please Register to submit score.
Average Score  7.3
Scores Submitted  3
Date Added  Mar 13, 2005
Last Updated  Sep 18, 2005
Tags  copy  file  ftp  http  secure 

Introduction

I've found this to be quite useful in handing uploaded files through HTTP. You can use this to move the file from your /tmp folder to a folder on your site that isn't mode 777. The concept is simple. It connects to your FTP server and puts the file in the folder of your choice. Usage:

ftp_copy("/tmp/tmpfile", "public_html/uploads");

Grab the Code

Comments

  (3)  RSS
log2
Comments: 52
 
PHP Snippet:  Secure File Copy using FTP through HTTP
Posted on Mar 13, 2005 4:20 am
Not bad... not bad at all, infact I could use this... but with my ftp... i don\'t think that would work too well lol, but i\'ll try, good job Hawkee
Gex
Comments: 94
 
PHP Snippet:  Secure File Copy using FTP through HTTP
Posted on Apr 25, 2007 9:30 am
Code:
if((!$conn_id) || (!$login_result))
   {
            echo \"FTP connection has failed!\";
            echo \"Attempted to connect to $ftp_server for user $ftp_user\";
      }

this block of code should be followed by exit(); to halt the rest of code...if am write..the rest of code will be executed if the connection to ftp failed
Gex
Comments: 94
 
PHP Snippet:  Secure File Copy using FTP through HTTP
Posted on Apr 25, 2007 9:34 am
to be more clear...the code should be >
Code:

if((!$conn_id) || (!$login_result))
   {
            echo \"FTP connection has failed!\";
            echo \"Attempted to connect to $ftp_server for user $ftp_user\";
exit();
      }

Please Register or Login to start posting comments.
Bottom