Hi guys, I use following widget organizing my ftp uploading, downloading and deleting
"yii2mod/yii2-ftp": "*",
This wdget is a desaster, 'cause it will upload faulty files to server. It’s just uploading a small part(in Bytes) of file,This phenomenon just will occur, if file is Winword or PDF. All other files will be uploaded correctly. So, I know, my code is correct. Here is var_dump() of a file, which actually has been uploaded faulty:
$putFile = $connection->put($SourceDirectory . $localFile, $LocalDirectory . $localFile, $mode);
var_dump($putFile);
var_dump($SourceDirectory.$localFile);
E:\xampp\htdocs\yii2_perswitch\common\wsl_components\FTPZugang.php:89:boolean true
E:\xampp\htdocs\yii2_perswitch\common\wsl_components\FTPZugang.php:90:string '/FTP_Server/Diverses/12_Joinabfragen.docx' (length=41)
Following rules are defined in PHP.INI
post_max_size=8M
upload_max_filesize=10M
max_file_uploads=20
;opcache.max_file_size=0
So, my question is: Could somebody recommend me a widget,which will upload( and download) all kind of files without any errors? Please, just recommend me a ftp-widget, If ur experiences with it are postiive!
Here is code of defining $mode for upper put();
public function DateienHochloaden($render, $connection, $localFile, $LocalDirectory) {
$session = new Session();
$docx = '/docx/';
$txt = '/txt/';
$pdf = '/pdf/';
$xlsx = '/xlsx/';
$pptx = '/pptx/';
$basis = $this->GetZugangsDaten($render);
$SourceDirectory = $basis[3];
if (preg_match($docx, $localFile) || preg_match($txt, $localFile) || preg_match($pdf, $localFile) || preg_match($xlsx, $localFile) || preg_match($pptx, $localFile))
$mode = FTP_ASCII;
else
$mode = FTP_BINARY;
.
.
.