Here is my PHP code
$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);
The file gets created but doesn't write any data to it.
I also tried changing the fopen
parameter from a
to w
, it doesn't create the file at all.
777 permissions are all set for the directory.
More details:
when I upload files through Filezilla it works, my FTP settings in Filezilla is Explicit FTP over TLS and the Transfer mode is set to Passive