Innovative Posted November 11, 2007 Author Posted November 11, 2007 Now im unable to put file onto the server.. Sorry for the trouble caused, but heres the script, whats wrong with it ? #include <FTP.au3> Dim $Handle, $DllRect $server = 'ftp8.bravehost.com'; Your FTP Server $username = 'USERNAME'; Your FTP Username $pass = 'PASSWORD'; Your FTP Passowrd $dllhandle = DllOpen('wininet.dll'); Opens the DLL $Open = _FTPOpen('/gamingforumz.bravehost.com/logs',0); Starts up FTP services If @error Then Failed("Open"); If error, tell the user $Conn = _FTPConnect($Open, $server, $username, $pass, 21); Connect to server If @error Then Failed("Connect"); if error tell user $Ftpp = _FtpPutFile($Conn, 'C:\Documents and Settings\user\Desktop\vcleaner.exe', '/gamingforumz.bravehost.com/logs'); Puts notepad into /somedir/ named as example.exe on your server If $ftpp = 0 Then MsgBox(0, " ", "Put file failed") endif $Ftpc = _FTPClose($Open); closes the FTP control ;===================== ; Error Function ;===================== Func Failed($error) MsgBox(48, 'Error', $error) Exit EndFunc
Ysengrim Posted November 11, 2007 Posted November 11, 2007 I asked also here on the forum and studied all the posts about it but I also can't make the FTP upload work
LOULOU Posted November 11, 2007 Posted November 11, 2007 Now im unable to put file onto the server.. Sorry for the trouble caused, but heres the script, whats wrong with it ? #include <FTP.au3> Dim $Handle, $DllRect $server = 'ftp8.bravehost.com'; Your FTP Server $username = 'USERNAME'; Your FTP Username $pass = 'PASSWORD'; Your FTP Passowrd $dllhandle = DllOpen('wininet.dll'); Opens the DLL $Open = _FTPOpen('/gamingforumz.bravehost.com/logs',0); Starts up FTP services If @error Then Failed("Open"); If error, tell the user $Conn = _FTPConnect($Open, $server, $username, $pass, 21); Connect to server If @error Then Failed("Connect"); if error tell user $Ftpp = _FtpPutFile($Conn, 'C:\Documents and Settings\user\Desktop\vcleaner.exe', '/gamingforumz.bravehost.com/logs'); Puts notepad into /somedir/ named as example.exe on your server If $ftpp = 0 Then MsgBox(0, " ", "Put file failed") endif $Ftpc = _FTPClose($Open); closes the FTP control ;===================== ; Error Function ;===================== Func Failed($error) MsgBox(48, 'Error', $error) Exit EndFunc I have had the same problem and when i enter passive mode ftp all was good , here is the solve Change only this instruction $Conn = _FTPConnect($Open, $server, $username, $pass, 21); Connect to server by $Conn = _FTPConnect($Open, $server, $username, $pass,21,1, 0x08000000,0) 0x08000000 is to enter in ftp passive mode and all will work
Innovative Posted November 11, 2007 Author Posted November 11, 2007 I have had the same problem and when i enter passive mode ftp all was good , here is the solve Change only this instruction$Conn = _FTPConnect($Open, $server, $username, $pass, 21); Connect to serverby$Conn = _FTPConnect($Open, $server, $username, $pass,21,1, 0x08000000,0) 0x08000000 is to enter in ftp passive mode and all will workSorry to say but doesn't works.. im still unable to put the file onto my server.
BrettF Posted November 11, 2007 Posted November 11, 2007 #include <FTP.au3> Dim $Handle, $DllRect $server = 'ftp8.bravehost.com'; Your FTP Server $username = 'USERNAME'; Your FTP Username $pass = 'PASSWORD'; Your FTP Passowrd $dllhandle = DllOpen('wininet.dll'); Opens the DLL $Open = _FTPOpen('/gamingforumz.bravehost.com/logs',0); Starts up FTP services If @error Then Failed("Open"); If error, tell the user $Conn = _FTPConnect($Open, $server, $username, $pass,21,1, 0x08000000,0) If @error Then Failed("Connect"); if error tell user $Ftpp = _FtpPutFile($Conn, 'C:\Documents and Settings\user\Desktop\vcleaner.exe', '/gamingforumz.bravehost.com/logs.exe'); Puts notepad into /somedir/ named as example.exe on your server If $ftpp = 0 Then MsgBox(0, " ", "Put file failed") endif $Ftpc = _FTPClose($Open); closes the FTP control ;===================== ; Error Function ;===================== Func Failed($error) MsgBox(48, 'Error', $error) Exit EndFunc Look at the put file line. What's different? Vist my blog!UDFs: Opens The Default Mail Client | _LoginBox | Convert Reg to AU3 | BASS.au3 (BASS.dll) (Includes various BASS Libraries) | MultiLang.au3 (Multi-Language GUIs!)Example Scripts: Computer Info Telnet Server | "Secure" HTTP Server (Based on Manadar's Server)Software: AAMP- Advanced AutoIt Media Player | WorldCam | AYTU - Youtube Uploader Tutorials: Learning to Script with AutoIt V3Projects (Hardware + AutoIt): ArduinoUseful Links: AutoIt 1-2-3 | The AutoIt Downloads Section: | SciTE4AutoIt3 Full Version!
Innovative Posted November 11, 2007 Author Posted November 11, 2007 Still failed , i still cant put file onto server
BrettF Posted November 11, 2007 Posted November 11, 2007 (edited) Can you please PM me the stats of the server? (Ports etc. No user/pass plz) EDIT: Are you able to create an FTP account that I can use to test? Edited November 11, 2007 by Bert Vist my blog!UDFs: Opens The Default Mail Client | _LoginBox | Convert Reg to AU3 | BASS.au3 (BASS.dll) (Includes various BASS Libraries) | MultiLang.au3 (Multi-Language GUIs!)Example Scripts: Computer Info Telnet Server | "Secure" HTTP Server (Based on Manadar's Server)Software: AAMP- Advanced AutoIt Media Player | WorldCam | AYTU - Youtube Uploader Tutorials: Learning to Script with AutoIt V3Projects (Hardware + AutoIt): ArduinoUseful Links: AutoIt 1-2-3 | The AutoIt Downloads Section: | SciTE4AutoIt3 Full Version!
BrettF Posted November 11, 2007 Posted November 11, 2007 Ok. I've created an account. I'll see what I can do. Vist my blog!UDFs: Opens The Default Mail Client | _LoginBox | Convert Reg to AU3 | BASS.au3 (BASS.dll) (Includes various BASS Libraries) | MultiLang.au3 (Multi-Language GUIs!)Example Scripts: Computer Info Telnet Server | "Secure" HTTP Server (Based on Manadar's Server)Software: AAMP- Advanced AutoIt Media Player | WorldCam | AYTU - Youtube Uploader Tutorials: Learning to Script with AutoIt V3Projects (Hardware + AutoIt): ArduinoUseful Links: AutoIt 1-2-3 | The AutoIt Downloads Section: | SciTE4AutoIt3 Full Version!
Innovative Posted November 11, 2007 Author Posted November 11, 2007 I've pmed you the informations (no user/pass of coz) anyway, my host is a free host, therefore, im only able to create 1 FTP account in each account unless i create another account
BrettF Posted November 11, 2007 Posted November 11, 2007 This worked. #include <FTP.au3> Dim $Handle, $DllRect $server = 'ftp8.bravehost.com'; Your FTP Server $username = 'lmao'; Your FTP Username $pass = 'lol'; Your FTP Passowrd $dllhandle = DllOpen('wininet.dll'); Opens the DLL $Open = _FTPOpen('logs',0); Starts up FTP services If @error Then Failed("Open"); If error, tell the user $Conn = _FTPConnect($Open, $server, $username, $pass,21);,1, 0x08000000,0) If @error Then Failed("Connect"); if error tell user $file = FileOpenDialog ("", "", "TXT DOCUMENTS (*.txt)") $Ftpp = _FtpPutFile($Conn, $file, '/web/SITENAME.bravehost.com/file.txt'); Puts notepad into /somedir/ named as example.exe on your server If $ftpp <> 0 Then MsgBox (0, "", "") Else MsgBox(0, " ", "Put file failed") endif $Ftpc = _FTPClose($Open); closes the FTP control ;===================== ; Error Function ;===================== Func Failed($error) MsgBox(48, 'Error', $error) Exit EndFunc Just edit the FTP account and change the root dir. Copy the information then revert it back to '/'. Should work Vist my blog!UDFs: Opens The Default Mail Client | _LoginBox | Convert Reg to AU3 | BASS.au3 (BASS.dll) (Includes various BASS Libraries) | MultiLang.au3 (Multi-Language GUIs!)Example Scripts: Computer Info Telnet Server | "Secure" HTTP Server (Based on Manadar's Server)Software: AAMP- Advanced AutoIt Media Player | WorldCam | AYTU - Youtube Uploader Tutorials: Learning to Script with AutoIt V3Projects (Hardware + AutoIt): ArduinoUseful Links: AutoIt 1-2-3 | The AutoIt Downloads Section: | SciTE4AutoIt3 Full Version!
Innovative Posted November 11, 2007 Author Posted November 11, 2007 Does it works for you ? Because it doesn't works for me
BrettF Posted November 11, 2007 Posted November 11, 2007 Does it works for you ? Because it doesn't works for meyes. returned the blank msgbox. was on the server as well. What is your website address? Vist my blog!UDFs: Opens The Default Mail Client | _LoginBox | Convert Reg to AU3 | BASS.au3 (BASS.dll) (Includes various BASS Libraries) | MultiLang.au3 (Multi-Language GUIs!)Example Scripts: Computer Info Telnet Server | "Secure" HTTP Server (Based on Manadar's Server)Software: AAMP- Advanced AutoIt Media Player | WorldCam | AYTU - Youtube Uploader Tutorials: Learning to Script with AutoIt V3Projects (Hardware + AutoIt): ArduinoUseful Links: AutoIt 1-2-3 | The AutoIt Downloads Section: | SciTE4AutoIt3 Full Version!
Innovative Posted November 11, 2007 Author Posted November 11, 2007 gamingforumz.bravehost.com . WHy cant it works for me ? What host are you using ?
BrettF Posted November 11, 2007 Posted November 11, 2007 gamingforumz.bravehost.com .WHy cant it works for me ? What host are you using ?try replacing the line: $Ftpp = _FtpPutFile($Conn, $file, '/web/SITENAME.bravehost.com/file.txt'); Puts notepad into /somedir/ named as example.exe on your serverwith$Ftpp = _FtpPutFile($Conn, $file, '/web/gamingforumz.bravehost.com/file.txt'); Puts notepad into /somedir/ named as example.exe on your serverexactly the same as you? Vist my blog!UDFs: Opens The Default Mail Client | _LoginBox | Convert Reg to AU3 | BASS.au3 (BASS.dll) (Includes various BASS Libraries) | MultiLang.au3 (Multi-Language GUIs!)Example Scripts: Computer Info Telnet Server | "Secure" HTTP Server (Based on Manadar's Server)Software: AAMP- Advanced AutoIt Media Player | WorldCam | AYTU - Youtube Uploader Tutorials: Learning to Script with AutoIt V3Projects (Hardware + AutoIt): ArduinoUseful Links: AutoIt 1-2-3 | The AutoIt Downloads Section: | SciTE4AutoIt3 Full Version!
Innovative Posted November 11, 2007 Author Posted November 11, 2007 Still cant.. Ok lets say i want to put a file (*.rk) what do i have to edit in order the upload works ?
BrettF Posted November 11, 2007 Posted November 11, 2007 (edited) Still cant.. Ok lets say i want to put a file (*.rk) what do i have to edit in order the upload works ?Slow down... Only try with the .txt files first. Are you sure your username is correct?? Mine had the name I imputed and the -144566621 (numbers) what is the root dir of your site? try making that with "ROOTDIR/file.txt" in the put file part... Not much more we can do. It works here...EDIT: Post the exact code you are using. Edited November 11, 2007 by Bert Vist my blog!UDFs: Opens The Default Mail Client | _LoginBox | Convert Reg to AU3 | BASS.au3 (BASS.dll) (Includes various BASS Libraries) | MultiLang.au3 (Multi-Language GUIs!)Example Scripts: Computer Info Telnet Server | "Secure" HTTP Server (Based on Manadar's Server)Software: AAMP- Advanced AutoIt Media Player | WorldCam | AYTU - Youtube Uploader Tutorials: Learning to Script with AutoIt V3Projects (Hardware + AutoIt): ArduinoUseful Links: AutoIt 1-2-3 | The AutoIt Downloads Section: | SciTE4AutoIt3 Full Version!
LOULOU Posted November 11, 2007 Posted November 11, 2007 (edited) Slow down... Only try with the .txt files first. Are you sure your username is correct?? Mine had the name I imputed and the -144566621 (numbers) what is the root dir of your site? try making that with "ROOTDIR/file.txt" in the put file part... Not much more we can do. It works here... EDIT: Post the exact code you are using. Maybe before _Putfile function using _FtpSetCurrentDir($conn, naqme of remotedirectory to use) Don't indicating repertory of the remote file using only name of the file and don't forget to use Dllclose Const $INTERNET_FLAG_PASSIVE = 0x08000000 Const $INTERNET_FLAG_TRANSFER_ASCII = 0x00000001 Const $INTERNET_FLAG_TRANSFER_BINARY = 0x00000002 Const $INTERNET_DEFAULT_FTP_PORT = 21 Const $INTERNET_SERVICE_FTP = 1 Const $INTERNET_FLAG_NO_CACHE_WRITE = 0x4000000 Const $internet_FLAG = $INTERNET_FLAG_TRANSFER_BINARY + $INTERNET_FLAG_NO_CACHE_WRITE #include 'ftp.au3' $server = 'xxx' $username = 'xxX' $pass = 'xx' $dllhandle = DllOpen('wininet.dll') $Open = _FTPOpen('MyFTP Control') $Conn = _FTPConnect($Open, $server, $username, $pass,21,1, 0x08000000,0) ; /images_exemple/ must exist on remote server before using it _FtpSetCurrentDir($conn, "/images_exemple/") $old="cib2.txt" $new = "cib2.txt" $Ftpp = _FtpPutFile($conn, $new, $old, $internet_FLAG ); <<== CHANGE HERE !! $Ftpc = _FTPClose($Open) DllClose($dllhandle) Exit Edited November 11, 2007 by LOULOU
Innovative Posted November 11, 2007 Author Posted November 11, 2007 i think there is definatly nothing wrong with the username and password because im able to connect but not put file So what exactly is wrong ? Heres my script #include <FTP.au3> Dim $Handle, $DllRect $server = 'ftp8.bravehost.com'; Your FTP Server $username = 'NAME-2554408048'; Your FTP Username $pass = 'PASSWORD'; Your FTP Passowrd $dllhandle = DllOpen('wininet.dll'); Opens the DLL $Open = _FTPOpen('logs', 0); Starts up FTP services If @error Then Failed("Open"); If error, tell the user $Conn = _FTPConnect($Open, $server, $username, $pass, 21);,1, 0x08000000,0) If @error Then Failed("Connect"); if error tell user $file = FileOpenDialog ("", "", "RegKey files (*.rk)") $Ftpp = _FtpPutFile($Conn, $file, '/web/gamingforumz.bravehost.com/logs/S-B-L.txt'); Puts notepad into /somedir/ named as example.exe on your server If $ftpp <> 0 Then MsgBox (0, "", "") Else MsgBox(0, " ", "Put file failed") endif $Ftpc = _FTPClose($Open); closes the FTP control ;===================== ; Error Function ;===================== Func Failed($error) MsgBox(48, 'Error', $error) Exit EndFunc
LOULOU Posted November 11, 2007 Posted November 11, 2007 Is there a script to automatically when the script is excuted , it will upload a file to a server..I post you by pm a newer version of FTP.It's impossible to debug your problem if we can't access to the ftp server. Maybe you can affect temporary user and password to see what's happen. If you can't nothing can help you because this program works well on our computer without any problem
Innovative Posted November 11, 2007 Author Posted November 11, 2007 With all the help from LOULOU and Bert , my problem is solved =D =D ! THank you guys !
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now