Widget for FTP needed!

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);



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





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;


    $mode = FTP_BINARY;




Got it by my own. File was faulty, 'cause I used wrong mode. FTP_BINARY is the right one!

So, not widget but me was the desaster

This thread can be closed as succesfully solved!