Jump to content

FTP Upload Help Please ! ???


Recommended Posts

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)

Link to comment
Share on other sites

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)
                ConsoleWrite("Upload: fehlgeschlagen " & " " & @error & @CRLF)
            MsgBox(0, "Connect", "fehlgeschlagen")
            ConsoleWrite("Connect: " & " " & $errFTP & @CRLF)
        MsgBox(0, "Open", "fehlgeschlagen")
        ConsoleWrite("Open " & " " & $errOpen & @CRLF)
    _FTP_Close($l_InternetSession) ;schliesst die FTP-Sitzung
EndFunc   ;==>_example1
Edited by ElFuego

My scripts: Logfile Snippet

Link to comment
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

  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...