Jump to content

Help with FTP Upload


Recommended Posts

Ok, I usually try all the stops before posting to a forum, but this one actully has me stumped.

I am using the FTP.au3 i found here in the forums. I then proceeded to try to upload files to my ftp server. However I am not getting anywhere. _FtpPutFile returns a 0 and @error returns -1.

_FTPOpen = 13369348

_FTPConnect = 13369352

Steps I took:

1) I recieved msgbox outputs from the connections, recieve what look like good responses.

2) I called the GetLastError function from wininet.dll, recieved a 0 for a response.

3) Tried switching between binary and ASCI modes, no luck there either.

4) I found that the @error is being set to -1 because of $ai_FTPPutFile[0] = 0 in the _FTPPutFile UDF. This confused me because I read on MSDN it is supposed to be a BOOL.

What I think:

I believe it may be a problem with my FTP server, since it is remote and I think I have eliminated everything else. Please if anyone has suggestions or comments, please please help me. This was supposed to be a quick and easy one. HA!

#Include <ftp.au3>
$server = EDITED
$username = EDITED
$pass = EDITED
Dim $dllhandle = DllOpen('wininet.dll')
$Open = _FTPOpen('MyFTP')
$conn = _FTPConnect($Open, $server, $username, $pass)
;MsgBox(0,"FTPOpen",$Open)
;MsgBox(0,"FTPConn",$conn)
$search = FileFindFirstFile("T:\tests\*.*")

While 1
$file = FileFindNextFile($search) 
 If @error Then ExitLoop
;   MsgBox(0,"File Name",$file)
$Ftpp = _FtpPutFile($conn,"T:\tests\" & $file,"/tests/" & $file)
WEnd
$Ftpc = _FTPClose($Open)
FileClose($search)
DllClose($dllHandle)
Link to comment
Share on other sites

Ok, I usually try all the stops before posting to a forum, but this one actully has me stumped.

I am using the FTP.au3 i found here in the forums. I then proceeded to try to upload files to my ftp server. However I am not getting anywhere. _FtpPutFile returns a 0 and @error returns -1.

_FTPOpen = 13369348

_FTPConnect = 13369352

Steps I took:

1) I recieved msgbox outputs from the connections, recieve what look like good responses.

2) I called the GetLastError function from wininet.dll, recieved a 0 for a response.

3) Tried switching between binary and ASCI modes, no luck there either.

4) I found that the @error is being set to -1 because of $ai_FTPPutFile[0] = 0 in the _FTPPutFile UDF. This confused me because I read on MSDN it is supposed to be a BOOL.

What I think:

I believe it may be a problem with my FTP server, since it is remote and I think I have eliminated everything else. Please if anyone has suggestions or comments, please please help me. This was supposed to be a quick and easy one. HA!

#Include <ftp.au3>
$server = EDITED
$username = EDITED
$pass = EDITED
Dim $dllhandle = DllOpen('wininet.dll')
$Open = _FTPOpen('MyFTP')
$conn = _FTPConnect($Open, $server, $username, $pass)
;MsgBox(0,"FTPOpen",$Open)
;MsgBox(0,"FTPConn",$conn)
$search = FileFindFirstFile("T:\tests\*.*")

While 1
$file = FileFindNextFile($search) 
 If @error Then ExitLoop
;   MsgBox(0,"File Name",$file)
$Ftpp = _FtpPutFile($conn,"T:\tests\" & $file,"/tests/" & $file)
WEnd
$Ftpc = _FTPClose($Open)
FileClose($search)
DllClose($dllHandle)
If I put my own server, username and password, and change "T:\tests" to suit my PC and change the destination path then it all works fine for me.

I guess that if you get sensible values for $open and $conn then there is something wrong with your destination path.

Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.
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
 Share

  • Recently Browsing   0 members

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