Sign in to follow this  
Followers 0
MarkVR

FTP Upload

3 posts in this topic

Hi I need to get a user to access my FTP server without giving him the password.

I am trying the following but the send command doesnt work:

$Fullcommand = @ComSpec & " /k FTP testftpsite.com"

RunWait($Fullcommand,@Scriptdir,@SW_Show)

WinWaitActive("c:\")

sleep(500)

Send("Username{Enter}")

Send("Pasword{Enter}")

Any ideas please?

Thanks

Share this post


Link to post
Share on other sites



He could always get a packet scanner and just read the password from that.

You should use a secure FTP connection, or just create another FTP account just for him.

Share this post


Link to post
Share on other sites

He could always get a packet scanner and just read the password from that.

You should use a secure FTP connection, or just create another FTP account just for him.

Ok thanks for the input m8 :D

After trolling the forum a bit I found FTP.au3.. Woot thx very much. I did the following and it works fine for me.

#include <Inet.au3>

#include <FTP.au3>

#include <GUIConstants.au3>

$Form1 = GUICreate("FTP Uploader", 320, 125, 193, 125)

$Inppath = GUICtrlCreateInput("", 32, 40, 177, 21)

$Lblpath = GUICtrlCreateLabel("Enter the directory where the file is. ie (c:\data\)", 32, 16, 250, 17)

$Lblfile = GUICtrlCreateLabel("Enter the filename. ie (Video.txt)", 32, 70, 200, 17)

$Inpfile = GUICtrlCreateInput("", 32, 85, 177, 21)

$BtnUpload = GUICtrlCreateButton("Upload", 240, 50, 50, 33, 0)

GUISetState(@SW_SHOW)

While 1

$Msg = GUIGetMsg()

Select

Case $msg = $GUI_EVENT_CLOSE

ExitLoop

Case $msg = $btnUpload

Upload()

Case Else

;;;

EndSelect

WEnd

Exit

Func Upload()

$server = "Site"

$username = "User"

$pass = "PSW"

$dllhandle = DllOpen('wininet.dll')

$path = GUICtrlRead($Inppath)

$file = GUICtrlRead($Inpfile)

$source = $path&$file

$Open = _FTPOpen("Upload")

$Conn = _FTPConnect($Open, $server, $username, $pass)

$Ftpp = _FtpPutFile($Conn, $source, "/www/video/"&$file)

$Ftpc = _FTPClose($Open)

DllClose($dllhandle)

MsgBox(0,"Upload status", $source & " has been uploaded")

Exit

EndFunc

Regards

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