Hi Techy,
How to make a simple php upload script that would automatically save, send and replace the recently edited file on my FTP server everytime it detects a change on the .php file ?
Thanks in advance.
Automate FTP file on server with a simple php upload script
Hey there Charles,Â
PHP is a very useful and easy language, and I believe that it wont be too long for you to learn the basics. I am giving you here an "upload" script in php and this will help you with your automation project. Just make sure that you got all the tools you need when starting and working all the way your project to lessen delays. Hope this help you solve your problem.
For more information about PHP go to : W3 School's Website
Waall Mike
Automate FTP file on server with a simple php upload script
Hello!!
I am very glad to receive your interesting problem. And I am giving some important suggestions.
This is an exclusive script for uploading file into your server.
Here a function isset is used to locate and upload the file from a specific directory. I am giving just the code for uploading the file type of jpeg and gif. Â
<?PHP
$upload_dir ="images";
Â
if ( isset($_FILES['fupload'])) {
   $file_name = $_FILES['fupload']['name'];
   $file_type = $_FILES['fupload']['type'];
  Â
   if ($file_type =="image/jpeg" or $file_type=="image/gif")
   {
      copy($_FILES['fupload']['tmp_name'], "$upload_dir/$file_name") or die("Couldn't copy");
      print "<img src="$upload_dir/$file_name"<p>";
   }
}
?>
Â
Regards
Shifflett Laurel
Â