Jump to content
Sign in to follow this  
Synthesis

Write a file & ftp upload

Recommended Posts

Synthesis

hello all!

I've got another problem... >_<

Here's my script :

filedelete ('C:\program files\text.txt')
fileopen ('C:\program files\text.txt',1)
FileWriteLine ('C:\program files\text.txt', "something")
fileclose ('C:\program files\text.txt')


$server = 'something.com'
$username = 'nephentes'
$pass = 'password'
$Open = _FTPOpen('MyFTP Control')
$Conn = _FTPConnect($Open, $server, $username, $pass)
$Ftpp = _FtpPutFile($Conn, 'C:\program files\text.txt', '/public_html/text.txt')
$Ftpc = _FTPClose($Open)

The problem is the following : it creates my file, but it doesn't upload it. Why? (PS : I've tried 2 ftp accounts and still the same problem)

Please help me! It's a project that I need to finish it until September..

Share this post


Link to post
Share on other sites
Yashied
water

Could you do a consolewrite after eacht FTP command to see if everythin works fine?

Could you change

$Ftpp = _FtpPutFile($Conn, 'C:\program files\text.txt', '/public_html/text.txt')
to
$Ftpp = _FtpPutFile($Conn, 'C:\program files\text.txt', 'text.txt')

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (2018-06-01 - Version 1.4.9.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2018-09-01 - Version 1.3.4.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Share this post


Link to post
Share on other sites
Synthesis

Could you do a consolewrite after eacht FTP command to see if everythin works fine?

Could you change

$Ftpp = _FtpPutFile($Conn, 'C:\program files\text.txt', '/public_html/text.txt')
to
$Ftpp = _FtpPutFile($Conn, 'C:\program files\text.txt', 'text.txt')

I've tried this.

Share this post


Link to post
Share on other sites
water

So every return code you get looks fine and the two variations of _FTPPutFile don't work as well?


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (2018-06-01 - Version 1.4.9.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2018-09-01 - Version 1.3.4.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Share this post


Link to post
Share on other sites
water

Could you change "C:\program files\..." to "C:\temp\..." just to be sure you have full access rights?

BTW: What OS do you use, what AutoIT version do you use?

Edited by water

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (2018-06-01 - Version 1.4.9.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2018-09-01 - Version 1.3.4.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Share this post


Link to post
Share on other sites
Synthesis

Could you change "C:\program files\..." to "C:\temp\..." just to be sure you have full access rights?

BTW: What OS do you use, what AutoIT version do you use?

I am the administrator on this computer.

I use Windows XP SP2

I use AutoIT 3.3

Share this post


Link to post
Share on other sites
water

Soon I'll be running out of ideas >_<

Do you have access to the FTP server? If yes could you check the logs to see how far you get? Connection established, PUT started, error codes etc.?

Edited by water

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (2018-06-01 - Version 1.4.9.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2018-09-01 - Version 1.3.4.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Share this post


Link to post
Share on other sites
Dacha204

Old thread, I know, but problem remains.

Ok, I had similar problem and solved it by enabling Passive mode when connecting to server.

$Conn = _FTP_Connect($Open, $server, $username, $pass,1)

From help file:

_FTP_Connect($l_InternetSession, $s_ServerName, $s_Username, $s_Password [, $i_Passive = 0 [, $i_ServerPort = 0 [, $l_Service = 1 [, $l_Flags = 0 [, $l_Context = 0]]]]])

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  

×