Func _FileRecieve($sFileName, $iAccSocket)
Local $sBuff, $sRecv = "", $i = 0, $iFirstWhile = True
If @error Then Return 0
$sBuff = Binary ($sBuff)
While $sRecv = ""
$sRecv = TCPRecv($iAccSocket, 2048, 1)
$sRecv = BinaryToString ($sRecv)
WEnd
While $sRecv <> ""
If StringInStr($sRecv, ',') And $iFirstWhile Then
$sTmp = StringLeft($sRecv, StringInStr($sRecv, ",") - 1)
$sRecv = StringTrimLeft($sRecv, StringLen($sTmp) + 1)
If StringLen($sFileName) < 1 Then $sFileName = $sTmp
$iFirstWhile = False
EndIf
$sBuff &= $sRecv
$sRecv = BinaryToString (TCPRecv($iAccSocket, 2048, 1))
If @error Then ExitLoop
WEnd
$iFileOp = FileOpen($sFileName, 16 + 2)
If @error Then Return 0
FileWrite($iFileOp, $sBuff)
If @error Then Return 0
FileClose($iFileOp)
Return 1
EndFunc ;==>_FileReceive