Jump to content

FTP_FileGet not working as expected


Recommended Posts

I am trying to download a zip-file from my FTP server.

$Ftpp = _FTP_FileGet($Conn, '/tecweb/prod/1001/x64/tecweb1001.zip', 'C:\Program Files"\tecweb\tecweb1001.zip', False, 0, $FTP_TRANSFER_TYPE_BINARY)
    
$Ftpp = _FTP_FileGet($Conn, '/tecweb/prod/1001/x64/tecweb1001.zip', 'D:\tecweb1001.zip', False, 0, $FTP_TRANSFER_TYPE_BINARY)

The first line is my "original" line, however that line produces an -1 error (with extended error: 5)
The second line (changing the target to drive D:) works.
So I tried encapsulating the target with extra quotation marks "'text'" (single around double) and "'text'" (double around single quotes).

Both did't work.
I also replaces "Program Files\tecweb\" with "Progra~1\tecweb\" but this also does not work.

Does any fellow autoit scriptors have an idea ?
(I am planning to dive into FTPEx.au3 tomorow or friday, to see if I find out why _FTP_FileGet is behaving like this) 🙂

 

Link to comment
Share on other sites

  • Developers
'C:\Program Files"\tecweb\tecweb1001.zip'

Why is there a doubleqoute in the string?

Does the script have write access as in general the "C:\program Files" requires admin rights?

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

The doublet quote is a left over from testing and should be removed.

The script does not require admin rights, because the user has modify  rights in on the tecweb subfolder.

I could however run the script with #require admin to be sure it isn't a security issue after all...

Thanks for the suggestion.🙂

Link to comment
Share on other sites

@JosThanks for pointing me in the right direction. It was indeed a rights problem. 

I normally have an installer creating the tecweb folder in Program Files and adjusting the rights.
In this case however (because I was programming/testing) I must have created the tecweb folder manually and forgot set the security.:D
After changing the folder permission to "change" for the logged in user, I was able to copy the file from FTP without a problem.

Thanks again for your help!:thumbsup:

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