Jump to content

_Ftp.au3 -> _FTP_Put Problem


 Share

Recommended Posts

Good evening!

My English is not so good, but I will try to explain my Problem :P

I bought a ftp server. Now I want to upload a file on the server, using _Ftp.au3 (latest version)

Here's my code:

$server = 'svr'
$username = 'usr'
$pass = 'pwd'

$Hand = _FTPOpen('FTPCon','','','',1) ; Connect in Passiv Mode
; @Error: No Error
$Ftpc = _FTPConnect($Hand, $server, $username, $pass)
; @Error: No Error
_FtpPutFile($Hand, @Desktopdir"\myfile.txt", '/results/textfile.txt')
; @Error: -1
$Ftpc = _FTPClose($Hand)
; @Error: No Error

Does anyone know what this Error may cause?

Maybe its a general Problem ?

Thanks in Advance

Take Care

Lenny

Edited by Lenny
Link to comment
Share on other sites

At least you need to do this @Desktopdir & "\myfile.txt"

Scripts & functions Organize Includes Let Scite organize the include files

Yahtzee The game "Yahtzee" (Kniffel, DiceLion)

LoginWrapper Secure scripts by adding a query (authentication)

_RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...)

Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc.

MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times

Link to comment
Share on other sites

  • 4 weeks later...

Also, I think you should pass the return value of _FTPConnect(....) in the arguments of _FtpPutFile($Ftpc....) and not _FtpPutFile($Hand....)

$Ftpc = _FTPConnect($Hand, $server, $username, $pass)

; @Error: No Error

_FtpPutFile($Hand, @Desktopdir"\myfile.txt", '/results/textfile.txt')

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...