Sign in to follow this  
Followers 0
faustf

ftp put problems

3 posts in this topic

hi guys 

i have  a script  for put some  foto in a directory in server byethost , but i dont know  why not  work and  not return error

Func _FTP_upload()
    GUISetCursor(15, 1)
    Local $aCecked = _Simply_Checked_listviewe_Return($SITIWEB_NewItem_List2, "Array")
    Local $sPath = GUICtrlRead($SITIWEB_NewItem_Input5)

    $sServer = IniRead(@ScriptDir & "\WEB-SITE\eBay\FTP\config_ftp.ini", "ftp_config", "server", "default")
    $sUsername = IniRead(@ScriptDir & "\WEB-SITE\eBay\FTP\config_ftp.ini", "ftp_config", "user", "default")
    $sPass = IniRead(@ScriptDir & "\WEB-SITE\eBay\FTP\config_ftp.ini", "ftp_config", "passw", "default")
    $port = IniRead(@ScriptDir & "\WEB-SITE\eBay\FTP\config_ftp.ini", "ftp_config", "port", "default")
    $passive = 1

    Local $hOpen = _FTP_Open('MyFTP eBay_park')
    Local $hConn = _FTP_Connect($hOpen, $sServer, $sUsername, $sPass, $passive, $port)
    If @error Then
        MsgBox($MB_SYSTEMMODAL, '_FTP_Connect', 'ERROR=' & @error)
    Else
        Local $fuFunctionToCall = _UpdateProgress

        For $i = 0 To UBound($aCecked) - 1
            ;$Ftpp = _FTP_FilePut($hConn, $sPath & "\" & $aCecked[$i], '/htdocs/eBay',$FTP_TRANSFER_TYPE_BINARY)

            ProgressOn("Upload Progress", $aCecked[$i])
            _FTP_ProgressUpload($hConn, $sPath & "\" & $aCecked[$i], '/htdocs/eBay', $fuFunctionToCall)
            Exit @error
            ProgressOff()
        Next
    EndIf
    Local $iFtpc = _FTP_Close($hConn)
    Local $iFtpo = _FTP_Close($hOpen)
    GUISetCursor(2, 1)
    MsgBox(0, 'info', 'fine upload')


EndFunc   ;==>_FTP_upload

i think because not wait after progresupload , is  possible , tell  wait finish  function ftp_progresupload  worked ?

thankz at all

:)

 

 

Share this post


Link to post
Share on other sites



i put   the  error string  after

_FTP_ProgressUpload($
If @error Then
                MsgBox($MB_SYSTEMMODAL, '_FTP_ProgressUpload', 'ERROR=' & @error)
            EndIf

and i have  returned  error -3

reate File failed

 

but is  strange  because  with  file zilla i can create it

 

Share this post


Link to post
Share on other sites
Quote

Return Value

Success: 1.
Failure: 0 and sets the @error flag to non-zero.
@error: -1 - Local file couldn't be opened
-3 - Create File failed
-4 - Write to file failed
-5 - Close File failed
-6 - Download aborted by PercentageFunc and Return of Called Function

says your remote file couldn't be created. No wonder the remotepath is a folder without filename! 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0