PHP : Send a file with FTP


Back to programming.


*php_ftp    (2009-04-17)
PHP : Send a file with FTP

This small PHP script will allow you to send a file through FTP, you just have to know the address, login & password of the server you want to put the file on :


$ftp_server = '213.186.xx.xx';

$ftp_user_name = 'ns30xxx.ovh.net';
$ftp_user_pass = 'xxxxxxxx';

$message = '';


if (file_exists($source_file))
{
  $conn_id = ftp_connect($ftp_server);
 
  $login_result = ftp_login($conn_id, $ftp_user_name, $ftp_user_pass);

  if ((!$conn_id) || (!$login_result))
  {
    $message .= 'FTP connection failed. <br><br>';
  }
  else
  {
    $message .= 'FTP connection succeeded. <br><br>';
  }
 
  $upload = ftp_put($conn_id, $destination_file, $source_file, FTP_BINARY);
 
  if (!upload)  $message = 'FTP upload failed. <br><br>';
  else  $message = 'FTP upload succeeded. <br><br>';
 
  ftp_close($conn_id);

  print $message;




(more options below)

*frank    (2010-07-20 18:27:27)
PHP : Send a file with FTP

I'm surprised people are still using FTP - with easy online file transfer services like ht*p://www.filesdirect.com it seems rather unnecessary...it's a convoluted, archaic methodology that's really only of interest to those of us in IT. Average users (understandably) find it difficult and  confusing. Between the security issues (only partly resolved by SFTP), usability issues and management issues, what's the point?


*nazudo    (2010-12-04 14:56:05)
13 years ago

how can i upload my php save file through the internet explorer using ftp


See also


ficgs
More websites

You must register to see these links, as this is a collaborative page, then you may change the order of the links by clicking the icons before the titles.



admin
Other websites

The following links might be less relevant, please change their ranks if you find them useful.


 PHP send file directly to FTP - Programming
forums.whirlpool.net > forum replies archive.cfm/1054739

 Send Files via FTP Using PHP
davidwalsh > send files ftp

Many other has then made the program up to version...
Obviously the die() can be replaced with your own error handler,...

 FileZilla - Client Download
filezilla project > download.

 PHP FTP file upload example
jonasjohn > snippets

// turn on passive mode transfers (some servers need...
// If you are using PHP4 then you need to use this...

 FTP Class (ftp, ftp class) - PHP Classes
phpclasses > browse/package/1772

 SourceForge.net: FileZilla: Files
sourceforge > project/showfiles.

 PHP FTP vs. File Upload - Codewalkers
forums.codewalkers

We cover the world of technology like no one else,...
Warburton's the largest independently owned bakery in the UK faced a...

 Keep your options open with FTP file uploads using PHP
articles.techrepublic.com > 5100 10878 11 6069684

element then forces the form data to be encoded as a multi-part...
Top Ten Things Every IT Pro Should Know about IE8 on Windows...

 PHP Script to FTP file to another website - bluehostforum.com
bluehostforum > showthread.

 curl FTP file Upload | PHP Script Forums
finalwebsites > forums/topic/curl ftp file upload

PHP related forum, discuss snippets, classes and...

 Tutorial: FTP Upload via cURL | Web Development Blog
web development blog > archives/tutorial ftp upload via curl

var shadowbox_conf = { animate: true, animateFade:...
PHP Mail Scripts using SMTP transport, a guide for...
E-mail marketing software, which is the best for...

 Uploading of files - The solution
en.kioskea > faq/sujet 1003 uploading of files

 Php Ftp Upload Form
trap17 > index.

 Uploading a file using Ajax and PHP's FTP? [Archive] - CodeGuru Forums
codeguru > forum/archive/index.

Good day, First of all I am as happy as monkey in a tree with the...
Forgive me, but where does the e-mail attachment come into play? It...
What does your AJAX request look like? It sounds like a GET instead...

 Error in uploading file via ftp server - PHP
daniweb > forums/thread147064

No one has posted to this discussion for at least three...

 Uploading Image File Through JSP Code To Server
astahost > info.

cm hago por favor a tener mi prpoa bae de datos en esta web, con...
Searching Video's for uploading, image, file, jsp, code,...

 upload file to ftp with html-form and php ? - Dev Shed
forums.devshed > ftp help 113/upload file to ftp with html form and

Safari Books Online provides searchable, on-demand access to...
Warburton's the largest independently owned bakery in the UK faced a...
Create the Optimal Architecture for your Critical...

 PHP's FTP functions tutorial
phpsense

Notice that path specified here is not the filesystem path, its the...
//Create a directory 'config' at the root of your...

 Overwriting a txt file using php and ftp. - Dynamic Drive Forums
dynamicdrive > forums/showthread.

 WinSCP :: Download
winscp > eng/download.

 Download PHP & FTP File Manager - PHP & FTP File Manager is a visual file manager developed in PHP, JAVASCRIPT and AJAX. - Softpedia
webscripts.softpedia > script/File Management Perl

It is possible that you typed the address incorrectly, or that the...

 PHP-General - How to send text data via ftp [Archive] - CodingForums.com
codingforums > archive/index.

The posted code could work, given the right conditions, and assuming...

 GetAFreelancer.com - App to send image files to multiple FTP addresses automatically from folder.
getafreelancer > projects/Perl CGI Java/App send image files multiple

 PHP IDE :: NuSphere Forums :: View topic - FTP client send MFMT?
forum.nusphere > viewtopic.

 PHP Edit FTP File at Script Software Informer
script.software.informer > download script

cross-platform, cross-database, data architecting...

 How To Upload File Via FTP Using PHP Code?, discussion in PHP Scripts Section
discussion.accuwebhosting

 Chmod - FTP File Permissions - STADTAUS.com
stadtaus > en/tutorials/chmod ftp file permissions.

If you have PHP and CGI scripts on your web server that...
Enter in the fields right beside the file lists the chmod command...
Enter in the field below file list the chmod command with your file...

 Code Examples -> very simple ftp class
weberdev > get example 4475

Start typing to search for PHP and MySQL Code Snippets and...
Class for sending mail with MIME attachments in multipart format...

 PHP form to upload via FTP
phpfreaks > forums/index.

 FTP Administration with full logging via PHP | Tudor-Alexandru Dobrila
blog.dta > 2007/09/26/ftp admin with log via

FTP Administration with full logging - Tutorial...
The constructor of the class will have 6 parameters: the $host of...
Most of the methods can be defined using the same pattern (validation...

 HOWTO Ridiculously easy home file sharing with FTP and Zeroconf - Ubuntu Forums
ubuntuforums > showthread.

How are you doing network printing? Is one box a print server or do...
local_enable=YES write_enable=YES anonymous_enable=NO...

 PHP Script to FTP file to another website - bluehostforum.com
bluehostforums > showthread.

 How do I use HomeBase to send a file via FTP? - Biblio.com
biblio > faq detail.

 send log file via ftp (file already in use) - Developer Discussion Boards
discussion.forum.nokia > forum/showthread.

 File permissions, created by PHP script - unable to delete through FTP!!!
forums.digitalpoint > showthread.

is there any way to delete the thread created by the...
File permissions, created by PHP script - unable to delete through...

 ftp code
snippets.dzone > tag/ftp

Recursively Transfer all files in certain directory...
FTPS upload a file from Ruby using Curl command...

 [dev] [cvs] commit: framework/VFS/VFS file.php ftp.php smb.php sql.php sql_file.php ssh2.php
lists.horde > archives/dev/Week of Mon 20060417/019636

 FastCGI error when upload a PHP file by FTP : The Official Microsoft IIS Site
forums.iis > t/1153815.aspx

 Download File Upload Download Using Ftp In Php Source Codes, File Upload Download Using Ftp In Php Scripts - X360 Ftp ActiveX OCX by X360 X360, Chili ...
sourcecodeonline > list?q=file upload download using ftp in

This is a php program which provides users an FTP connection to...
This script provides web browser FTP client facilities with...

 Keep your options open with FTP file uploads using PHP protocols - Program - Web Technologies - Builder AU
builderau.com > program/web/soa/Keep your options open with FTP file uploads usi

10 reasons why Windows Terminal Services is becoming more...
element then forces the form data to be encoded as a multi-part...



Response  
 

Guest name   (option)     Register
Please sum : 7965 + two  




Trackbacks : If you talked about this article in your blog or website, you may instantly get a backlink 
There's no trackback at the moment.