Sign in to follow this  
Followers 0
melf

ftp renaming before sending...

5 posts in this topic

#1 ·  Posted (edited)

Hi

Im having serious problems sending a file..

All i want the autoit script to do is send the only file that will be dumped in a specific directory ( in this case a .ini file named by the players account info..example : peter-pan.ini )..so since the file will never have the same name i havent found how to the tell the script to upload *.*.ini file..

So what i tryed was to tell my first program to write down in name.txt file the name of the .ini to be sent and afterwards execute the autoit script..the autoit script goes like this

#include <FTP.au3> 
$lecture = FileOpen("C:\Imladris Database\Reception\name.txt", 1)
$filetitre = FileReadLine($lecture , 1)
$blabla = '\Reception\' 
$blabla2 = $blabla & $filetitre
$server = 'ftp.somewhere.com'
$username = '****'
$pass = '****'

$Open = _FTPOpen('MyFTP Control')
$Conn = _FTPConnect($Open, $server, $username, $pass)
$Ftpp = _FtpPutFile($Conn, 'C:\Imladris Database\Reception\fiche.ini', $blabla2)
$Ftpc = _FTPClose($Open)

at the other end on the ftp i get a file named "4" :)

can anyone help me out here please..how can i tell the script to send to the ftp the only file that will be dumped in the directory "reception" and name it the same thing at the other end..

Edited by melf

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

$blabla = '\Reception\' should be '/Reception/'

and if /Reception doesnt exist then _FTPMakeDir($conn, ???? , "/Reception" & ".ini") ;??

ummm thinking about it, what is it your expecting it save on the ftpsite again??

Edited by Rick

Who needs puzzles when we have AutoIt!!

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

i want to send a player named ini file to the ftp folder "reception"

example : peter-pan.ini on the client pc should be sent to the ftp named the same way

in other words i just want it to send the only file its got in the recpetion folder client side in the folder reception server side.

Edited by melf

Share this post


Link to post
Share on other sites

and peter-pan is line 1 result of $filetitre = FileReadLine($lecture , 1) ?


Who needs puzzles when we have AutoIt!!

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

how about...

#include <FTP.au3>

$lecture = FileOpen("C:\Imladris Database\Reception\name.txt", 1)

$filetitre = FileReadLine($lecture , 1)

$blabla = '\Reception\' & $filetitre & ".ini"

$server = 'ftp.somewhere.com'

$username = '****'

$pass = '****'

$Open = _FTPOpen('MyFTP Control')

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

$Ftpp = _FtpPutFile($Conn, 'C:\Imladris Database\Reception\fiche.ini', $blabla)

$Ftpc = _FTPClose($Open)

ps: you dont have to rename a file, you just ftpputfile it as a different name, just a thought.

Edited by Rick

Who needs puzzles when we have AutoIt!!

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