How to upload large file(s) on FTP server using php?


$ftp_server = 'ftp.abc.com'; $remote_file = "myvideo.avi"; // file size 210MB $file = "myvideo.avi"; // file size 210MB $conn_id = ftp_connect($ftp_server); // set up basic connection // login with username and password $login_result = ftp_login($conn_id, 'faraz@abc.com', 'password'); ftp_pasv($conn_id, true); // turn passive mode on // upload a file if (ftp_put($conn_id, $remote_file, $file, FTP_ASCII)) { echo "successfully uploaded $file\n"; } else { echo "There was a problem while uploading $file\n"; } // close the connection ftp_close($conn_id); i already edit php.in for upload_max_filesize = 1024M

above snippet working on all types of file(s) upload, <br /> but when am trying to upload a large size file then it upload on server but size varies after uploading.<br /> A video file size-210MB on local-machine <br /> but after upload, it displayed file size 328KB on FTP-server. <br /> i have no idea where do i check, if someone has suggestion then i appreciates


Use FTP_BINARY instead of FTP_ASCII. The latter might stop at the first NUL byte.

Besides that, there is no good reason to use ascii mode nowadays, even for ascii files. The <strong>only</strong> case where it's important if you have cgi scripts containing a shebang line that have windows linebreaks locally.


  • Using file_get_contents and ftp_put [closed]
  • What is the difference between Socket and ServerSocket?
  • Ionic - Upload file to FTP server
  • how to make file extensions to syntax highlighting in vim?
  • multiple applets in one jar file, multiple applets on one page?
  • In python 2.7 - How to read data from csv, reformat data, and write to new csv
  • IBM Worklight 6.0 - wl_antiXSRFRealm error after deploying adapter to Worklight Server
  • Upload file through vba and WinSCP.com
  • FTP transfer all files in a remote directory, and tweak permissions, using PHP
  • Why am I getting a segmentation fault in my C server program (but only sometimes)?
  • ftp_nlist(): data_accept: SSL/TLS handshake failed
  • Python w/Google Drive API
  • Cloudinary node.js progress of uploading
  • Cannot get the uploaded file name while using ajax
  • JQuery - unable to pass formData with other parameters
  • Upload a hosted image with Facebook's Graph API by url?
  • Oracle APEX upgrade from 5.0 to 5.1
  • Show HTML when flash fails?
  • WCF REST File upload with additional parameters
  • Command line upload of apk to google playstore
  • Google Calendar (API) questions
  • How to get the client IP address from the request made to webservice
  • File upload php, get only file name
  • how to create a downloadable csv file in appengine
  • Laravel Impossible to Create Root Directory
  • Upload file that is in the cpan database
  • Getting media player state in windows phone 7
  • perl, mysql - fasting way to upload a csv file into mysql?
  • How do I get HTML corresponding to current DOM tree?
  • azure media services - The request body is too large and exceeds the maximum permissible limit
  • Read a local file using javascript
  • Cannot resolve symbol 'MyApi'
  • How to show dropdown in excel using jrxml (jasper api)?
  • Adding custom controls to a full screen movie
  • -fvisibility=hidden not passed by compiler for Debug builds
  • coudnt use logback because of log4j
  • How to CLICK on IE download dialog box i.e.(Open, Save, Save As…)
  • How can I remove ASP.NET Designer.cs files?
  • Why is Django giving me: 'first_name' is an invalid keyword argument for this function?
  • How can I use `wmic` in a Windows PE script?