Sign in to follow this  
Followers 0
MasterX

ftp error

6 posts in this topic

#1 ·  Posted (edited)

I tried to upload a file to my ftp server.

#include<FTP.au3>
$server = 'ftp.tixter.ti.funpic.de'
$username = 'tixter'
$pass = '******; its the correct passport'

$Open = _FTPOpen('MyFTP Control')
$Conn = _FTPConnect($Open, $server, $username, $pass)
$Ftpp = _FtpPutFile($Conn, 'C:\WINDOWS\Notepad.exe', '/somedir/Example.exe')
$Ftpc = _FTPClose($Open)

But there isn´t any file on my server :)

It seems that there is a connection error.

Func _FTPConnect($l_InternetSession, $s_ServerName, $s_Username, $s_Password, $i_ServerPort = 21, $l_Service = 1, $l_Flags = 0, $l_Context = 0)
    
    Local $ai_InternetConnect = DllCall('wininet.dll', 'long', 'InternetConnect', 'long', $l_InternetSession, 'str', $s_ServerName, 'int', $i_ServerPort, 'str', $s_Username, 'str', $s_Password, 'long', $l_Service, 'long', $l_Flags, 'long', $l_Context)
    If @error OR $ai_InternetConnect[0] = 0 Then
        SetError(-1)
        [color="#FF0000"]MsgBox(0,"","errorConnect")[/color]
        Return 0
                Return $ai_InternetConnect[0]
            endif
EndFunc;==> _FTPConnect

Theres alway the msgbox.

Edited by MasterX

Share this post


Link to post
Share on other sites



I recomment adding

Dllcall("wininet.dll")

[quote]Don't expect for a perfect life ... Expect a least troubles ones[/quote]Contact me : ass@kiss.toWhat I Have Done :Favorites Manager Mangage your favorite's folder, that's coolPC Waker For those who want to save stickersWebScipts Supporter For those who've just started with Web and WebScriptsTemporary Looker Simple but powerful to manage your Temporary folder, you know what you downloaded[UDF] _NumberFormat() Better performance on number display[UDF] _DirGet() What a folder contain [how many (hidden,normal,...) files], with one line of code[UDF] _IsPressEs() Just like _IsPress() but for a group of keys

Share this post


Link to post
Share on other sites

*GERMAN* [note: you are not allowed to remove author / modified info from my UDFs]My UDFs:[_SetImageBinaryToCtrl] [_TaskDialog] [AutoItObject] [Animated GIF (GDI+)] [ClipPut for Image] [FreeImage] [GDI32 UDFs] [GDIPlus Progressbar] [Hotkey-Selector] [Multiline Inputbox] [MySQL without ODBC] [RichEdit UDFs] [SpeechAPI Example] [WinHTTP]UDFs included in AutoIt: FTP_Ex (as FTPEx), _WinAPI_SetLayeredWindowAttributes

Share this post


Link to post
Share on other sites

Doesn´t work either.

Share this post


Link to post
Share on other sites

I tested this UDF with my Funpic-Account, and it worked?

//OK, you have to create the dir first!

$Open = _FTPOpen('MyFTP Control')
$Conn = _FTPConnect($Open, $server, $username, $pass)
_FTPMakeDir($Conn,"/somedir")
$Ftpp = _FtpPutFile($Conn, 'C:\WINDOWS\Notepad.exe', '/somedir/Example.exe')
MsgBox(0, '', @error)
$Ftpc = _FTPClose($Open)

*GERMAN* [note: you are not allowed to remove author / modified info from my UDFs]My UDFs:[_SetImageBinaryToCtrl] [_TaskDialog] [AutoItObject] [Animated GIF (GDI+)] [ClipPut for Image] [FreeImage] [GDI32 UDFs] [GDIPlus Progressbar] [Hotkey-Selector] [Multiline Inputbox] [MySQL without ODBC] [RichEdit UDFs] [SpeechAPI Example] [WinHTTP]UDFs included in AutoIt: FTP_Ex (as FTPEx), _WinAPI_SetLayeredWindowAttributes

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