以下是我的PHP代码
$output = fopen('ftp://.io/inventory/'.$file_name, 'a');
fputcsv($output, array('ImportType','productCode','sku','locationCode','onHand'));
$newrow = array(0=>'AC',1=>'test',3=>'test2',4=>'test3',5=>'test4');
fputcsv($output,$newrow);
文件被创建了,但没有写入任何数据。
我也试过改变 fopen
参数从 a
到 w
,它根本就没有创建文件。
777权限都是为该目录设置的。
更多细节:当我通过Filezilla上传文件时,它可以工作,我在Filezilla的FTP设置是 Explicit FTP over TLS and the Transfer mode is set to Passive