Sign in to follow this  
Followers 0
lifesux

FTP Upload Help Please ! ???

3 posts in this topic

I have a ftp upload script. It works it sends them to the ftp but the files size are 0 at ftp . so i cant look them. help me please

$server = 'xxx.com'

$username = 'xxxx'

$pass = 'xxxx'

$Open = _FTP_Open('MyFTP Control')

$Conn = _FTP_Connect($Open, $server, $username, $pass)

_FTP_FilePut($Conn, "C:\xxx\xxxx\xxxxx\x.jpg", "/htdocs/x.jpg")

$Ftpc = _FTP_Close($Open)

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

Wow, you own xxx.com ? You got to be rich ;-)

Have you checked the @error variable ?

(BTW It would be nice if you post code using BBCode)

In the german translation of the Auto-It Docs I found an example script, maybe you try this one.

Func _example1()
    ;lädt eine Datei hoch
    Local $s_ServerName = 'guest.autobert.myplace.net' ;dieser Server existiert nicht
    Local $s_Username = "guest"
    Local $s_Password = "TopSecret"

    Local $s_LocalFile = @ScriptDir & "_FTP_FilePut3.au3"
    Local $s_RemoteFile = "/FTPTestfiles/_FTP_FilePut3.au3"
    Local $i_Passive = 0
    Local $l_InternetSession, $l_FTPSession, $errOpen, $errFTP
    $l_InternetSession = _FTP_Open('AuoItZilla') ;Öffnet eine FTP Sitzung
    $errOpen = @error
    If Not @error Then
        $l_FTPSession = _FTP_Connect($l_InternetSession, $s_ServerName, $s_Username, $s_Password, $i_Passive) ;Verbindet zu einem FTP Server
        $errFTP = @error
        If Not @error Then
            If _FTP_FilePut($l_FTPSession, $s_LocalFile, $s_RemoteFile) Then
                ConsoleWrite("Upload: erfolgreich" & @CRLF)
            Else
                ConsoleWrite("Upload: fehlgeschlagen " & " " & @error & @CRLF)
            EndIf
        Else
            MsgBox(0, "Connect", "fehlgeschlagen")
            ConsoleWrite("Connect: " & " " & $errFTP & @CRLF)
        EndIf
    Else
        MsgBox(0, "Open", "fehlgeschlagen")
        ConsoleWrite("Open " & " " & $errOpen & @CRLF)
    EndIf
    _FTP_Close($l_InternetSession) ;schliesst die FTP-Sitzung
EndFunc   ;==>_example1
Edited by ElFuego

My scripts: Logfile Snippet

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