Jump to content
Sign in to follow this  
vivec45

I need to make a quick ftp upload

Recommended Posts

vivec45

Could somebody make me up a simple script that uploads a file to ftp, the name of the file being $filename (defined earliar in the script)...

Thanks,

Vivec45

Share this post


Link to post
Share on other sites
d4rk

First,go to the example forum and download FTP.au3

and this's an example

#include <FTP.au3>
DllOpen('wininet.dll') 
$server = 'ftp.host.com'
$username = 'username'
$pass = 'password'

$Open = _FTPOpen('MyFTP Control')
$Conn = _FTPConnect($Open, $server, $username, $pass)
$Ftpp = _FtpPutFile($Conn, 'E:\AutoIt Project\d4rklog.txt', '/d4rklog.txt')
$Ftpc = _FTPClose($Open)

[quote]Don't expect for a perfect life ... Expect a least troubles ones[/quote]Contact me : ass@kiss.toWhat I Have Done :Favorites Manager Mangage your favorite's folder, that's coolPC Waker For those who want to save stickersWebScipts Supporter For those who've just started with Web and WebScriptsTemporary Looker Simple but powerful to manage your Temporary folder, you know what you downloaded[UDF] _NumberFormat() Better performance on number display[UDF] _DirGet() What a folder contain [how many (hidden,normal,...) files], with one line of code[UDF] _IsPressEs() Just like _IsPress() but for a group of keys

Share this post


Link to post
Share on other sites
vivec45

Could somebody make me up a simple script that uploads a file to ftp, the name of the file being $filename (defined earliar in the script)...

Thanks,

Vivec45

This does not seem to be working for me..

"

;Ftp upload

#include <FTP.au3>

DllOpen('wininet.dll')

$server = 'myinfo'

$username = 'myinfo'

$pass = 'myinfo'

$Open = _FTPOpen('MyFTP Control')

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

$Ftpp = _FtpPutFile($Conn, "/"&$filename, "/"&$filename)

$Ftpc = _FTPClose($Open)

;End Ftp upload

"

The script runs fine, but the file does not appear on the ftp server!

Edited by vivec45

Share this post


Link to post
Share on other sites
d4rk

yes, it's surely won't work :)

$Ftpp = _FtpPutFile($Conn, "\" & $filename, "/" & $filename)

[quote]Don't expect for a perfect life ... Expect a least troubles ones[/quote]Contact me : ass@kiss.toWhat I Have Done :Favorites Manager Mangage your favorite's folder, that's coolPC Waker For those who want to save stickersWebScipts Supporter For those who've just started with Web and WebScriptsTemporary Looker Simple but powerful to manage your Temporary folder, you know what you downloaded[UDF] _NumberFormat() Better performance on number display[UDF] _DirGet() What a folder contain [how many (hidden,normal,...) files], with one line of code[UDF] _IsPressEs() Just like _IsPress() but for a group of keys

Share this post


Link to post
Share on other sites
martin

yes, it's surely won't work :)

$Ftpp = _FtpPutFile($Conn, "\" & $filename, "/" & $filename)
I'd be surprised if that made any difference.

Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.

Share this post


Link to post
Share on other sites
vivec45

I'd be surprised if that made any difference.

So what's wrong with it?

Share this post


Link to post
Share on other sites
Jos

So what's wrong with it?

How about starting to add some error checking for each statement so you know where things go wrong.

Jos


Visit the SciTE4AutoIt3 Download page for the latest versions  - Beta files                                How to post scriptsource        Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites
d4rk

Isn't the "/" <> "\" make the difference ??

My uploaded code work very well

if "\" and "/" isn't the problem, so his host may does not support FTP, wrong Username || Password , etc...


[quote]Don't expect for a perfect life ... Expect a least troubles ones[/quote]Contact me : ass@kiss.toWhat I Have Done :Favorites Manager Mangage your favorite's folder, that's coolPC Waker For those who want to save stickersWebScipts Supporter For those who've just started with Web and WebScriptsTemporary Looker Simple but powerful to manage your Temporary folder, you know what you downloaded[UDF] _NumberFormat() Better performance on number display[UDF] _DirGet() What a folder contain [how many (hidden,normal,...) files], with one line of code[UDF] _IsPressEs() Just like _IsPress() but for a group of keys

Share this post


Link to post
Share on other sites
vivec45

Isn't the "/" <> "\" make the difference ??

My uploaded code work very well

if "\" and "/" isn't the problem, so his host may does not support FTP, wrong Username || Password , etc...

I am able to log into my ftp server and upload the file manually, but the script will not..

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  

×