Generate CSV file on an external FTP server in PHP

后端 未结 1 1938
感情败类
感情败类 2020-12-19 20:11

I have some PHP code that successfully exports a MySQL table to a CSV file.

I would like to add to that code, so instead of saving locally the CSL file is exported

1条回答
  •  隐瞒了意图╮
    2020-12-19 20:26

    If you have ftp:// URL wrappers enabled, just open the file directly on FTP server:

    $fp = fopen('ftp://username:password@ftp.example.com/path/to/somefile', 'w');
    

    If you do not have the wrapers enabled, see:
    Creating and uploading a file in PHP to an FTP server without saving locally

    0 讨论(0)
提交回复
热议问题