Transfer Files Via FTP in PHP

      No Comments on Transfer Files Via FTP in PHP

Here is a simple php snippet to upload files from the local server to a remote location:

Some hosting providers disable the option to use php ftp functions. However there is an alternative solution to upload files via ftp from php using the fopen/fwrite functions:

If the files are to big to be buffered all at once in memory, they can be copied on chunks in a loop, reading buffers of a specific size.

A third option if the first 2 can not be used would be to use curl from php:

Leave a Reply

Your email address will not be published. Required fields are marked *