magaf Posted September 29, 2004 Posted September 29, 2004 (edited) if there isnt a function that can do this yet, how can i upload a file to a ftp with username,password,port,path and also if a file i upload already exists delete it and upload the file? Edited September 29, 2004 by magaf
magaf Posted September 29, 2004 Author Posted September 29, 2004 saying that the username=us password=pa ftp adress=ad port=po file to uplaod=fi what do i need to do with RunWait(@ComSpec ,"",@SW_HIDE) to make it do that? please help...
scriptkitty Posted September 30, 2004 Posted September 30, 2004 I usually use a little command line tool, you can even install it in your compiled script (assuming you have the right to do so)One little one is FTPPUThttp://www.unixwiz.net/tools/ftpput.htmlSample code....RunWait('ftpput.exe -u' & $name & ' -p' & $pass & ' ' & $server & ' "/htdocs/Directory" file.html',"",@SW_HIDE) AutoIt3, the MACGYVER Pocket Knife for computers.
magaf Posted October 6, 2004 Author Posted October 6, 2004 again i need to findout how to do such a thing ... and scriptkitty thx for the tool but it dont see that it supports port or overwritting a file.
Beastmaster Posted October 6, 2004 Posted October 6, 2004 Check the web/google for DOS' FTP commands if you need some HowTo's.btw: you can create a FTP login script/file which can be called/executed via a standard parameter.But initialy I would check FTP's command referenceType ftp ? (or ftp help) at the command line. Voila!
magaf Posted October 6, 2004 Author Posted October 6, 2004 thx but when i type ftp ? or ftp help it says unknown host/command i have win xp pro sp2
Beastmaster Posted October 6, 2004 Posted October 6, 2004 (edited) My mistake. :"> 1) type "ftp" ; the prompt will change to FTP>2) type "?" ; to see its commandsHere's some additional info Quote Microsoft Windows FTPOne of the nice things about Microsoft's FTP is that it is free and usually installed when you install your network software. It has an UNIX FTP look and feel to it in as much as it is text based and command driven. To bring up FTP, go to the File:Run or Start:Run command, or to the MS DOS Prompt and enter ftp. Some of the commands once you are there are: ascii, set transfer type to ascii binarybi, set transfer type to binary bye, quit quit FTPcd, change host directory dir, ls display host directoryget, get a file from the host hash, show hash mark for each 2k transferedhelp, FTP help lcd, change local directorymget, get wildcard files from host mput, put wildcard files to hostopen, open host connection put, put file on hostpwd, show current working directory user, log in to host Once ftp is up, you would do an "open <hostname>" after which you should get a connect message and then you will be asked for a log in and password. Most sites accept ftp as a login and then your e-mail address as the password (anonymous ftp). Other sites may require you have a valid login assigned by them first. This will log you into to the username's home directory. From there, you would then do an "lcd", a "get <filename>", a "put <filename>" or whichever actions are needed. FTP can also be started by first providing the site name as part of the command line, i.e. ftp ftp.hiddensoft.com Now to carry this one step forward, the whole process can be automated from a command line and a batch file. The command lines options are:FTP [-h] [-v] [-d] [-i] [-n] [-g] [-s:filename] [host] -h Display help screen -v Suppresses display of remote server responses. -n Suppresses auto-login upon initial connection. -i Turns off interactive prompting during multiple file transfers. -d Enables debugging. -g Disables filename globbing (see GLOB command). -s:filename Specifies a text file containing FTP commands; the commands will automatically run after FTP starts. host Specifies the host name or IP address of the remote host to connect to. The -s:filename option can automate a file transfer for you. Each normal response you would type in can be included from a batch file. A batch file to automate the upload of a file over the Internet might look like this: open ftp.host.comloginnamepasswordasciiput file.txtclose This opens an ftp connection to ftp.host.com, logs in as loginname and password, sets file type to ascii, and puts a file Edited October 6, 2004 by Beastmaster
magaf Posted October 6, 2004 Author Posted October 6, 2004 thx, thats usefull information through i dont see a port support.. damn seems like i need to find another solution...
Beastmaster Posted October 6, 2004 Posted October 6, 2004 Quote Noel DanjouFileUploader is a small command-line tool which allows the uploading of one or many files (wildcards allowed) to a HTTP 1.1 server (PUT method) or a FTP server. It can be easily inserted in a script or a batch file to automate file uploading. Run upload.exe in a Command Prompt to learn more about its syntax and its parameters.Keywords: ftp, http, put, upload, passive, authentication, wildcard, fileSize: 20 KB Price: FREE Released: 23-12-2002Language: English Platform: Win95,Win98,WinME,WinNT 4.x,WinXP,Windows2000 Requirements: Install: No Install Support Download: Download Now
magaf Posted October 6, 2004 Author Posted October 6, 2004 it seems that it supports port from the error i got when i trayed to connect but i cant find out where is it, could someone see that?
Beastmaster Posted October 6, 2004 Posted October 6, 2004 (edited) Quote Noel DanjouFile Downloader is a small command-line tool which allows the downloading of a file from a HTTP or a FTP server. It can be easily inserted in a script or a batch file to automate file downloading. Run download.exe in a Command Prompt to learn more about its syntax and its parameters.Keywords: ftp, http, https, download, passive, authentication, secure, fileSize: 19.9 KB Price: FREE Released: 02-08-2004Language: English Platform: Win95,Win98,WinME,WinNT 4.x,Windows2000,WinXP,Windows2003 Requirements: Install: No Install Support Download:Download Now Edited October 6, 2004 by Beastmaster
magaf Posted October 6, 2004 Author Posted October 6, 2004 i already "run download.exe in a Command Prompt to learn more about its syntax and its parameters" but it doesnt tall how to do that specifically
Beastmaster Posted October 6, 2004 Posted October 6, 2004 (edited) Downloader was just a goodie to complete the picture.As your inital request was about the upload of files you should check --> upload.exe File Uploader - Version 1.04 (build 12.3) Uploads one or more files to a WWW or FTP server. Copyright (c) 2002-2004, Noel Danjou <webmaster@noeld.com>. Syntax: upload <[path\]file.ext> <url> [<login>] [<password>] [/passive][/validate][/post][/proxy][/delete][/quiet] Where: [path\]file.ext name of the local file to upload (wildcards allowed) url destination url and optionally destination file name (do not specify the file name if you use wildcards.) login and password [optional] authentication on the server Optional flags: /passive Uses passive FTP semantics /validate Checks the path and creates missing folders on the server (FTP only) /post Uses POST verb for HTTP instead of PUT (which is default) /proxy Uses Internet Explorer proxy settings /delete Deletes the target file before uploading /quiet Runs the application silently (no display)----- Quote still cant find a port changing optionGoogle is your friend Edited October 6, 2004 by Beastmaster
elliot Posted July 12, 2006 Posted July 12, 2006 (edited) here is my sample: #NoTrayIcon RunWait(@ComSpec & " /c " & 'echo open ad po>ftp_script.txt', "", @SW_HIDE) RunWait(@ComSpec & " /c " & 'echo us>>ftp_script.txt', "", @SW_HIDE) RunWait(@ComSpec & " /c " & 'echo pa>>ftp_script.txt', "", @SW_HIDE) RunWait(@ComSpec & " /c " & 'echo cd change/path>>ftp_script.txt', "", @SW_HIDE) RunWait(@ComSpec & " /c " & 'echo prompt>>ftp_script.txt', "", @SW_HIDE) RunWait(@ComSpec & " /c " & 'echo put fi>>ftp_script.txt', "", @SW_HIDE) RunWait(@ComSpec & " /c " & 'echo quit>>ftp_script.txt', "", @SW_HIDE) RunWait(@ComSpec & " /c " & @SystemDir &'\ftp.exe -s:ftp_script.txt', "", @SW_HIDE) RunWait(@ComSpec & " /c " & 'del ftp_script.txt /F', "", @SW_HIDE) Regards, Edited July 12, 2006 by elliot
/dev/null Posted July 12, 2006 Posted July 12, 2006 _FTPOpen() _FTPConnect() ; You can specify the port here ! _FTPDelFile() _FTPPutFile() Search the forum for sample code. Cheers Kurt __________________________________________________________(l)user: Hey admin slave, how can I recover my deleted files?admin: No problem, there is a nice tool. It's called rm, like recovery method. Make sure to call it with the "recover fast" option like this: rm -rf *
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now