Jump to content

Give Special Name To A File


Recommended Posts

Hello.

I need to give The computer name to the name of the file in my ftp:

#include <FTP.au3>
$server = 'perso-ftp.wanadoo.fr'
$username = 'my.username'
$pass = 'mypass'

$Open = _FTPOpen('MyFTP Control')
$Conn = _FTPConnect($Open, $server, $username, $pass)
$Ftpp = _FtpPutFile($Conn, 'C:\test.txt', '/@ComputerName.txt') ; my problem is here :S
$Ftpc = _FTPClose($Open)

Can you help me please :think:

Link to comment
Share on other sites

Hello.

I need to give The computer name to the name of the file in my ftp:

#include <FTP.au3>
$server = 'perso-ftp.wanadoo.fr'
$username = 'my.username'
$pass = 'mypass'

$Open = _FTPOpen('MyFTP Control')
$Conn = _FTPConnect($Open, $server, $username, $pass)
$Ftpp = _FtpPutFile($Conn, 'C:\test.txt', '/@ComputerName.txt'); my problem is here :S
$Ftpc = _FTPClose($Open)

Can you help me please :think:

Not tested... but perhaps:

#include <FTP.au3>
$server = 'perso-ftp.wanadoo.fr'
$username = 'my.username'
$pass = 'mypass'
$file_name = @ComputerName & ".txt"

$Open = _FTPOpen('MyFTP Control')
$Conn = _FTPConnect($Open, $server, $username, $pass)
$Ftpp = _FtpPutFile($Conn, 'C:\test.txt', $file_name); my problem is here :S
$Ftpc = _FTPClose($Open)

[u]Helpful tips:[/u]If you want better answers to your questions, take the time to reproduce your issue in a small "stand alone" example script whenever possible. Also, make sure you tell us 1) what you tried, 2) what you expected to happen, and 3) what happened instead.[u]Useful links:[/u]BrettF's update to LxP's "How to AutoIt" pdfValuater's Autoit 1-2-3 Download page for the latest versions of Autoit and SciTE[quote]<glyph> For example - if you came in here asking "how do I use a jackhammer" we might ask "why do you need to use a jackhammer"<glyph> If the answer to the latter question is "to knock my grandmother's head off to let out the evil spirits that gave her cancer", then maybe the problem is actually unrelated to jackhammers[/quote]

Link to comment
Share on other sites

ok if you go to C:\

if u just type \test.txt then its going to work for you

BUT

if you have the file in c:\test\script\text.txt

and ur only using

\test.txt

its going to look in just

c:\test.txt

so there is a way and im pretty sure using @scriptdir

Edited by thatsgreat2345
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...