Jump to content

Write a file & ftp upload


Recommended Posts

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..

Link to comment
Share on other sites

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 (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

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.
Link to comment
Share on other sites

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 (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

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 (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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 (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

  • 4 years later...

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]]]]])

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...