Jump to content

Upload File to FTP


 Share

Recommended Posts

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 ?
Link to comment
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.

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