Sign in to follow this  
Followers 0
Innovative

Upload file to server

41 posts in this topic

Is there a script to automatically when the script is excuted , it will upload a file to a server..

Share this post


Link to post
Share on other sites

Is there a script to automatically when the script is excuted , it will upload a file to a server..

What have you got to show us of what you've tried? What type of server? Does it have FTP? What are your intentions? Cause it sounds fishy to me.

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

Im using a free web host (bravehost.com) so what do i have to put in

$Open = _FTPOpen('MyFTP Control')

EDIT :

What about this.

I guess the first one is the location of the file i wanted to upload.. But what about the '/somedir/Example.exe'? What should i input into it ?

$Ftpp = _FtpPutFile($Conn, 'C:\WINDOWS\Notepad.exe', '/somedir/Example.exe')

Edited by CrazeStar1074

Share this post


Link to post
Share on other sites

Can someone kindly pls help me? urgent urgent.

Share this post


Link to post
Share on other sites

I know that, but i just cant find anything about that..

Just someone kindly please help me on

Im using a free web host (bravehost.com) so what do i have to put in

$Open = _FTPOpen('MyFTP Control')

EDIT :

What about this.

I guess the first one is the location of the file i wanted to upload.. But what about the '/somedir/Example.exe'? What should i input into it ?

$Ftpp = _FtpPutFile($Conn, 'C:\WINDOWS\Notepad.exe', '/somedir/Example.exe')

Share this post


Link to post
Share on other sites

What must i type into

$Open = _FTPOpen('MyFTP Control')

and

$Ftpp = _FtpPutFile($Conn, 'C:\WINDOWS\Notepad.exe', '/somedir/Example.exe')

Share this post


Link to post
Share on other sites

Can i have the link ? because i really cannot find the thread posted by him..

Share this post


Link to post
Share on other sites

Yes.. That was the question i was asking.. For the source of the FTP.au3,

what should i input into

$Open = _FTPOpen('MyFTP Control')

AND

$Ftpp = _FtpPutFile($Conn, 'C:\WINDOWS\Notepad.exe', '/somedir/Example.exe')

What should be in the _FTPOPEN('HERE')

and

_FTPPUTFILE($Conn, 'FILE PATH', 'What to put into here')

Share this post


Link to post
Share on other sites

#13 ·  Posted (edited)

Ok. So when you open FTP.au3, you have the headers for the UDF functions. Read what they contain.

The FTP Example:

$server = 'ftp.example.com'; Your FTP Server
$username = 'secretusers'; Your FTP username
$pass = 'hiddenpass'; FTP Password

$Open = _FTPOpen('MyFTP Control'); Initiates the FTP Control
$Conn = _FTPConnect($Open, $server, $username, $pass); Connects to the FTP, using the stated credentials.
$Ftpp = _FtpPutFile($Conn, 'C:\WINDOWS\Notepad.exe', '/somedir/Example.exe'); Puts notepad into /somedir/ named as example.exe on your server
$Ftpc = _FTPClose($Open); closes the FTP control

EDIT:

Header for _FTPOpen()

;===============================================================================

;

; Function Name: _FTPOpen()

; Description: Opens an FTP session.

; Parameter(s): $s_Agent - Random name. ( like "myftp" )

; $l_AccessType - I dont got a clue what this does.

; $s_ProxyName - ProxyName.

; $s_ProxyBypass - ProxyByPasses's.

; $l_Flags - Special flags.

; Requirement(s): DllCall, wininet.dll

; Return Value(s): On Success - Returns an indentifier.

; On Failure - 0 and sets @ERROR

; Author(s): Wouter van Kesteren.

;

;===============================================================================

Edited by Bert

Share this post


Link to post
Share on other sites

Sorry for the trouble but i do understand the _FtpPutfile but what is a FTP control ? im using bravehost what is the ftp control

Share this post


Link to post
Share on other sites

#15 ·  Posted (edited)

Well how to put this. The FTP control, in the instance i have used it is like starting Windows. It allows you to open GUIs. Lets you use your computer. In this case, it lets you use the FTP functions stated.

I imagine it will be set up like:

FTP Host = http://bravenet.com/

FTP Port = 21

FTP Directory = ""

Username/Password = Use the one given to you by Bravenet

Passive Mode = Yes

Edited by Bert

Share this post


Link to post
Share on other sites

An example of Passive FTP:

#include "FTP.au3"

Dim $Handle, $DllRect

$server = 'ftp.mozilla.org'; Your FTP Server
$username = 'anonymous'; Your FTP Username
$pass = 'anonymous'; Your FTP Passowrd

$dllhandle = DllOpen('wininet.dll'); Opens the DLL
$Open = _FTPOpen('MyFTP Control',0); Starts up FTP services
If @error Then Failed("Open"); If error, tell the user
$Conn = _FTPConnect($Open, $server, $username, $pass, 1); Connect to server
If @error Then Failed("Connect"); if error tell user

$where = "/pub/mozilla.org/firefox/releases/2.0.0.3/win32/en-US/Firefox Setup 2.0.0.3.exe"
$putfile = @ScriptDir&"\FirefoxSetup2003.exe"

$Ftpp = _FtpGetFile($Conn, $putfile, $where, $INTERNET_FLAG_PASSIVE, 0); Put the file onto the server
If $Ftpp = 0 Then Failed("Could not get"); If error, alert user
$Ftpc = _FTPClose($Open); close the FTP control
DllClose($dllhandle); Close the dll

;=====================
;          Error Function
;=====================
Func Failed($error)
    MsgBox(48, 'Error', $error)
    Exit
EndFunc

Share this post


Link to post
Share on other sites

Im unable to connect in all my tries.. Heres my script , whats wrong with it ?

EDIT : im sure my username and password was correct

#include <FTP.au3>

Dim $Handle, $DllRect

$server = 'ftp.webhosting4free.info'; Your FTP Server
$username = 'USERNAME'; Your FTP Username
$pass = 'PASSWORD'; Your FTP Passowrd

$dllhandle = DllOpen('wininet.dll'); Opens the DLL
$Open = _FTPOpen('/gamingforumz.webhosting4free.info/',0); Starts up FTP services
If @error Then Failed("Open"); If error, tell the user
$Conn = _FTPConnect($Open, $server, $username, $pass, 1); Connect to server
If @error Then Failed("Connect"); if error tell user

$Ftpp = _FtpPutFile($Conn, 'C:\WINDOWS\Notepad.exe', '/htdocs/Example.exe'); Puts notepad into /somedir/ named as example.exe on your server
$Ftpc = _FTPClose($Open); closes the FTP control

;=====================
;           Error Function
;=====================
Func Failed($error)
    MsgBox(48, 'Error', $error)
    Exit
EndFuncoÝ÷ Øw«zËaxTÏjíÚºÚ"µÍÏOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOBÂÈ[Ý[Û[YNÑÜ[
BÈØÜ[ÛÜ[È[ÙÜÚ[ÛÈ[Y]ÊN   ÌÍÜ×ÐYÙ[KH[ÛH[YK
ZÙH    ][ÝÛ^Y    ][ÝÈ
BÈ ÌÍÛÐXØÙÜÕHKHHÛÛÝHÛYHÚ]ÈÙËÈ ÌÍÜ×ÔÞS[YHKHÞS[YKÈ  ÌÍÜ×ÔÞPÜÂKHÞPTÜÙÉÌÎNÜËÈ    ÌÍÛÑYÜÈKHÜXÚX[YÜËÈ]Z[Y[
ÊNØ[Ú[[]È][YJÊNÛÝXØÙÜÈH]È[[[YYÈÛZ[HH[Ù]ÈTÔÈ]]ÜÊNÛÝ][ÙÝ[ÂÏOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOB[ÈÑÜ[  ÌÍÜ×ÐYÙ[  ÌÍÛÐXØÙÜÕHHK    ÌÍÜ×ÔÞS[YHH   ÌÎNÉÌÎNË  ÌÍÜ×ÔÞPÜÈH  ÌÎNÉÌÎNË  ÌÍÛÑYÜÈH
BBSØØ[    ÌÍØZWÒ[]Ü[HØ[
    ÌÎNÝÚ[[]    ÌÎNË ÌÎNÛÛÉÌÎNË  ÌÎNÒ[]Ü[ÌÎNË ÌÎNÜÝÌÎNË    ÌÍÜ×ÐYÙ[  ÌÎNÛÛÉÌÎNË  ÌÍÛÐXØÙÜÕK  ÌÎNÜÝÌÎNË    ÌÍÜ×ÔÞS[YK    ÌÎNÜÝÌÎNË    ÌÍÜ×ÔÞPÜË   ÌÎNÛÛÉÌÎNË  ÌÍÛÑYÜÊBRYÜÔ    ÌÍØZWÒ[]Ü[ÌHH[BTÙ]ÜLJBBT]Q[YBBT]    ÌÍØZWÒ[]Ü[ÌBB[[ÈÏOIÝÈÑÜ[
BÏOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOBÂÈ[Ý[Û[YNÑÛÛXÝ

BÈØÜ[ÛÛÛXÝÈÈ[ÙÈ[Y]ÊN    ÌÍÛÒ[]ÙÜÚ[ÛKHHÛÈÛHÑÜ[
BÈ ÌÍÜ×ÔÙ[YHBKHÙ[YKÚÈ ÌÍÜ×ÕÙ[YHBKHÙ[YKÈ   ÌÍÜ×ÔÜÝÛÜBBKHÜÝÛÜÈ    ÌÍÚWÔÙÜBKHÙÜ
ÈY][
JH
BÂBBBBIÌÍÛÔÙXÙBBBKHHÛÛÝHÛYHÚ]ÈÙËÂBBBBIÌÍÛÑYÜÂBBKHÜXÚX[YÜËÂBBBBIÌÍÛÐÛÛ^BBKHHÛÛÝHÛYHÚ]ÈÙËÈ]Z[Y[
ÊNØ[Ú[[]È][YJÊNÛÝXØÙÜÈH]È[[[YYÈÛZ[HH[Ù]ÈTÔÈ]]ÜÊNÛÝ][ÙÝ[ÂÏOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOB[ÈÑÛÛXÝ
    ÌÍÛÒ[]ÙÜÚ[Û ÌÍÜ×ÔÙ[YK ÌÍÜ×ÕÙ[YK ÌÍÜ×ÔÜÝÛÜ  ÌÍÚWÔÙÜH  ÌÍÛÔÙXÙHHK    ÌÍÛÑYÜÈH  ÌÍÛÐÛÛ^H
BBSØØ[    ÌÍØZWÒ[]ÛÛXÝHØ[
    ÌÎNÝÚ[[]    ÌÎNË ÌÎNÛÛÉÌÎNË  ÌÎNÒ[]ÛÛXÝ    ÌÎNË ÌÎNÛÛÉÌÎNË  ÌÍÛÒ[]ÙÜÚ[Û ÌÎNÜÝÌÎNË    ÌÍÜ×ÔÙ[YK ÌÎNÚ[    ÌÎNË ÌÍÚWÔÙÜ   ÌÎNÜÝÌÎNË    ÌÍÜ×ÕÙ[YK ÌÎNÜÝÌÎNË    ÌÍÜ×ÔÜÝÛÜ  ÌÎNÛÛÉÌÎNË  ÌÍÛÔÙXÙK  ÌÎNÛÛÉÌÎNË  ÌÍÛÑYÜË   ÌÎNÛÛÉÌÎNË  ÌÍÛÐÛÛ^
BRYÜÔ ÌÍØZWÒ[]ÛÛXÝÌHH[BTÙ]ÜLJBBT]Q[YBBBT]   ÌÍØZWÒ[]ÛÛXÝÌBB[[ÈÏOIÝÈÑÛÛXÝ

BÏOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOBÂÈ[Ý[Û[YNÑ][J
BÈØÜ[Û]È[[HÛ[ÙÈ[Y]ÊN   ÌÍÛÑÙÜÚ[ÛKHHÛÈÛHÑÛÛXÝ

BÈ ÌÍÜ×ÓØØ[[HKHHØØ[[KÈ   ÌÍÜ×Ô[[ÝQ[HKHH[[ÝHØØ][ÛÜH[KÈ    ÌÍÛÑYÜÂBKHÜXÚX[YÜËÈ  ÌÍÛÐÛÛ^KHHÛÛÝHÛYHÚ]ÈÙËÈ]Z[Y[
ÊNØ[Ú[[]È][YJÊNÛÝXØÙÜÈHBÈÛZ[HHÈ]]ÜÊNÛÝ][ÙÝ[ÂÏOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOB[ÈÑ][J  ÌÍÛÑÙÜÚ[Û   ÌÍÜ×ÓØØ[[K   ÌÍÜ×Ô[[ÝQ[K   ÌÍÛÑYÜÈH  ÌÍÛÐÛÛ^H
BSØØ[ ÌÍØZWÑ][HHØ[
    ÌÎNÝÚ[[]    ÌÎNË ÌÎNÚ[    ÌÎNË ÌÎNÑ][IÌÎNË   ÌÎNÛÛÉÌÎNË  ÌÍÛÑÙÜÚ[Û   ÌÎNÜÝÌÎNË    ÌÍÜ×ÓØØ[[K   ÌÎNÜÝÌÎNË    ÌÍÜ×Ô[[ÝQ[K   ÌÎNÛÛÉÌÎNË  ÌÍÛÑYÜË   ÌÎNÛÛÉÌÎNË  ÌÍÛÐÛÛ^
BRYÜÔ ÌÍØZWÑ][VÌHH[BTÙ]ÜLJBBT]Q[YBT]   ÌÍØZWÑ][VÌBB[[ÈÏOIÝÈÑ][J
BÏOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOBÂÈ[Ý[Û[YNÑ[[J
BÈØÜ[Û[]H[[HÛH[ÙÈ[Y]ÊN  ÌÍÛÑÙÜÚ[ÛKHHÛÈÛHÑÛÛXÝ

BÈ ÌÍÜ×Ô[[ÝQ[HKHH[[ÝHØØ][ÛÜH[KÈ]Z[Y[
ÊNØ[Ú[[]È][YJÊNÛÝXØÙÜÈHBÈÛZ[HHÈ]]ÜÊNÛÝ][ÙÝ[ÂÏOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOB[ÈÑ[[J  ÌÍÛÑÙÜÚ[Û   ÌÍÜ×Ô[[ÝQ[JBBSØØ[   ÌÍØZWÑ][HHØ[
    ÌÎNÝÚ[[]    ÌÎNË ÌÎNÚ[    ÌÎNË ÌÎNÑ[]Q[IÌÎNË ÌÎNÛÛÉÌÎNË  ÌÍÛÑÙÜÚ[Û   ÌÎNÜÝÌÎNË    ÌÍÜ×Ô[[ÝQ[JBRYÜÔ    ÌÍØZWÑ][VÌHH[BTÙ]ÜLJBBT]Q[YBT]   ÌÍØZWÑ][VÌBB[[ÈÏOIÝÈÑ[[J
BÏOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOBÂÈ[Ý[Û[YNÑ[[YQ[J
BÈØÜ[Û[[YÈ[[HÛ[ÙÈ[Y]ÊN ÌÍÛÑÙÜÚ[ÛKHHÛÈÛHÑÛÛXÝ

BÈ ÌÍÜ×Ñ^Ý[ÈKHHÛ[H[YKÈ    ÌÍÜ×Ó]ÈBKHH]È[H[YKÈ]Z[Y[
ÊNØ[Ú[[]È][YJÊNÛÝXØÙÜÈHBÈÛZ[HHÈ]]ÜÊNÛÝ][ÙÝ[ÂÏOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOB[ÈÑ[[YQ[J   ÌÍÛÑÙÜÚ[Û   ÌÍÜ×Ñ^Ý[Ë    ÌÍÜ×Ó]ÊBBSØØ[   ÌÍØZWÑ[[YQ[HHØ[
    ÌÎNÝÚ[[]    ÌÎNË ÌÎNÚ[    ÌÎNË ÌÎNÑ[[YQ[IÌÎNË    ÌÎNÛÛÉÌÎNË  ÌÍÛÑÙÜÚ[Û   ÌÎNÜÝÌÎNË    ÌÍÜ×Ñ^Ý[Ë    ÌÎNÜÝÌÎNË    ÌÍÜ×Ó]ÊBRYÜÔ    ÌÍØZWÑ[[YQ[VÌHH[BTÙ]ÜLJBBT]Q[YBT]    ÌÍØZWÑ[[YQ[VÌBB[[ÈÏOIÝÈÑ[[YQ[J
BÏOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOBÂÈ[Ý[Û[YNÑXZÙQ
BÈØÜ[ÛXZÙÈ[XÝÜHÛ[ÙÈ[Y]ÊN    ÌÍÛÑÙÜÚ[ÛKHHÛÈÛHÑÛÛXÝ

BÈ ÌÍÜ×Ô[[ÝHBKHH[H[YHÈH[]YÈ]Z[Y[
ÊNØ[Ú[[]È][YJÊNÛÝXØÙÜÈHBÈÛZ[HHÈ]]ÜÊNÛÝ][ÙÝ[ÂÏOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOB[ÈÑXZÙQ    ÌÍÛÑÙÜÚ[Û   ÌÍÜ×Ô[[ÝJBBSØØ[ ÌÍØZWÑXZÙQHØ[
    ÌÎNÝÚ[[]    ÌÎNË ÌÎNÚ[    ÌÎNË ÌÎNÑÜX]QXÝÜIÌÎNË   ÌÎNÛÛÉÌÎNË  ÌÍÛÑÙÜÚ[Û   ÌÎNÜÝÌÎNË    ÌÍÜ×Ô[[ÝJBRYÜÔ  ÌÍØZWÑXZÙQÌHH[BTÙ]ÜLJBBT]Q[YBT] ÌÍØZWÑXZÙQÌBB[[ÈÏOIÝÈÑXZÙQ
BÏOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOBÂÈ[Ý[Û[YNÑ[
BÈØÜ[Û[]IÌÎNÜÈ[XÝÜHÛ[ÙÈ[Y]ÊN  ÌÍÛÑÙÜÚ[ÛKHHÛÈÛHÑÛÛXÝ

BÈ ÌÍÜ×Ô[[ÝHBKHHXÝÜHÈH[]YÈ]Z[Y[
ÊNØ[Ú[[]È][YJÊNÛÝXØÙÜÈHBÈÛZ[HHÈ]]ÜÊNÛÝ][ÙÝ[ÂÏOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOB[ÈÑ[    ÌÍÛÑÙÜÚ[Û   ÌÍÜ×Ô[[ÝJBBSØØ[ ÌÍØZWÑ[HØ[
    ÌÎNÝÚ[[]    ÌÎNË ÌÎNÚ[    ÌÎNË ÌÎNÑ[[ÝQXÝÜIÌÎNË   ÌÎNÛÛÉÌÎNË  ÌÍÛÑÙÜÚ[Û   ÌÎNÜÝÌÎNË    ÌÍÜ×Ô[[ÝJBRYÜÔ  ÌÍØZWÑ[ÌHH[BTÙ]ÜLJBBT]Q[YBBT]    ÌÍØZWÑ[ÌBB[[ÈÏOIÝÈÑ[
BÏOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOBÂÈ[Ý[Û[YNÑÛÜÙJ
BÈØÜ[ÛÛÜÙÈHÑÜ[ÙÜÚ[ÛÈ[Y]ÊN   ÌÍÛÒ[]ÙÜÚ[ÛKHHÛÈÛHÑÜ[
BÈ]Z[Y[
ÊNØ[Ú[[]È][YJÊNÛÝXØÙÜÈHBÈÛZ[HHÈ]]ÜÊNÛÝ][ÙÝ[ÂÏOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOB[ÈÑÛÜÙJ  ÌÍÛÒ[]ÙÜÚ[ÛBBSØØ[ ÌÍØZWÒ[]ÛÜÙR[HHØ[
    ÌÎNÝÚ[[]    ÌÎNË ÌÎNÚ[    ÌÎNË ÌÎNÒ[]ÛÜÙR[IÌÎNË   ÌÎNÛÛÉÌÎNË  ÌÍÛÒ[]ÙÜÚ[ÛBRYÜÔ  ÌÍØZWÒ[]ÛÜÙR[VÌHH[BTÙ]ÜLJBBT]Q[YBT]   ÌÍØZWÒ[]ÛÜÙR[VÌBB[[ÈÏOIÝÈÑÛÜÙJ

Share this post


Link to post
Share on other sites

Maybe your server doesn't allow .exe uploads? Try with something simple like a txt file.

Share this post


Link to post
Share on other sites

It does allow .exe uploads. So what exactly is wrong with the script ? The problem is i cant connect to the ftp

Share this post


Link to post
Share on other sites

$Conn = _FTPConnect($Open, $server, $username, $pass, 1); Connect to server

Should be

$Conn = _FTPConnect($Open, $server, $username, $pass, 21); Connect to 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