Sign in to follow this  
Followers 0
LastSoul

Upload File to FTP

6 posts in this topic

hey guys

i want to upload file to FTp But its not Uploading i use this code :

 

Dim $sUsername = 'xxxxxx'
Dim $sPass = 'xxxxxxx'
Dim $sServer = 'ftp://xxxxxxxx/'

 

 

Local $hOpen = _FTP_Open('MyFTP Control')
Local $hConn = _FTP_Connect($hOpen, $sServer, $sUsername, $sPass)
_FTP_FilePut ( $hOpen, @DesktopDir & "1.txt" , "1.txt")
_FTP_Close($hConn)
_FTP_Close($hOpen)
 
 
why not uploading ?

Share this post


Link to post
Share on other sites



Try to debug which part is not working :) How to "debug"? You put msgboxes after each line to see if it's working:

$hOpen = _FTP_Open('MyFTP Control')
$hConn = _FTP_Connect($hOpen, $sServer, $sUsername, $sPass)
$hPutFile = _FTP_FilePut ( $hOpen, @DesktopDir & "\1.txt" , "1.txt")
MsgBox(0,"", "Open: " & $hOpen & @CRLF & "Connect: " & $hConn & @CRLF & "PutFile: " & $hPutFile)
_FTP_Close($hConn)
_FTP_Close($hOpen)

See where it fails and try to re-think what could be the problem. I'm sure the problem will be at the FilePut part. Usually you need something like public_html1.txt.

Share this post


Link to post
Share on other sites

not work 

Untitled.png

 i tried with vb.net and its upload but with autoit not working why ?

Share this post


Link to post
Share on other sites

It seems it can't even connect before uploading. Are you sure that you didn't mistype anything in yoru script? (I mean username, password, server).

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