Setup FTP download from vb.net or PowerShell script.

I'm trying to create a script to download a file to a PC. I setup the download domain and set a user up in that domain. I then created my script with the user and password and I can connect, get the file, although it is not the full file. The file is 347Kb and it only downloads 14kb. I looked on the server and it never shows I logged in. How would one setup a download of this sorts? I can't use WinSCP or any other download client, this has to be silent from the users PC.

Parents
  • Hi it sounds like a configuration problem or code issue. If you try with the GUI version of WinSCP this will verify the server is set up correctly and then you can use the command-line tools in WinSCP to transfer files 'silently' without the need for interaction. There is documentation here: winscp.net/.../scripting

  • Thanks Calc2014,

    I tried with WinSCP, this is what I get

    2022-08-31 10:30:09.568 Connecting to ftp.server ...
    . 2022-08-31 10:30:09.568 Connected with ftp.server. Waiting for welcome message...
    < 2022-08-31 10:30:09.584 220 Serv-U FTP Server v15.3.1 ready...
    > 2022-08-31 10:30:09.584 USER username
    < 2022-08-31 10:30:09.595 331 User name okay, need password.
    > 2022-08-31 10:30:09.595 PASS ********
    < 2022-08-31 10:30:09.637 530 Not logged in.
    . 2022-08-31 10:30:09.637 Connection failed.
    . 2022-08-31 10:30:09.647 Password prompt (last login attempt failed)
    * 2022-08-31 10:30:10.494 (ESshFatal)

    I have setup many users to connect, but now it seems it doesn't work as it use to. I can't use WinSPC in the code because it requires the SSH-RSA key which each time you upgrade Serv-U it creates a new key. This makes our users have to update the application each time before running it. I am trying to minimized that. I've tried just about every setting. Even regular FTP, no encryption, still doesn't allow me in

  • If you look at the Domain Activity log when you try the above, does it give any other info? It may be that the user doesnt have permission assigned in Serv-U to access their home folder.

  • When I try in WinSCP, it prompts for the password, enter password, prompts again. The Domain Activity log does not even show I am hitting it. Which is weird, I have the listeners setup correctly, at least I think I do lol. Its shouldn't be hard if you use the wizard to setup the domain. Which I did. Maybe I will delete it and try to add it again.

  • So I deleted the domain, added my user to an existing domain and limited it to a certain directory. I can now login with WinSCP, with SFTP. But the code I am using is only allowing me to use HTTPS. Apparently we can't use Https?

  • Sounds like another domain was already listening on the same IP address and port.

    You can use WinSCP command line to transfer files without a GUO in scripts, details here: https://winscp.net/eng/docs/scripting

    I'm not sure what code you have so I cant really advise on that, but serv-u supports FTP(S) and SFTP for file transfers and there are lots of applications and libraries that support this.

  • So basically I can't use HTTPs to do what I want? I also said I cannot use WinSCP to do this as it requires -hostkey="ssh-rsa 2048 xxxx..." which changes every time I upgrade Serv-u. So therefore I can't keep updating users computers each and every time we upgrade Serv-u. So far I can use any code that I find and it doesn't work.


    for instance, https://docs.microsoft.com/en-us/dotnet/framework/network-programming/how-to-download-files-with-ftp


    if I use "ftp://" server-u states (530) Not logged in.' Yet I do not see me even hitting the server in the logs, that is the response I get from the code.

  • If it isnt showing in the logs, there is probably something else listening on port 21, or you may be looking at the server log rather than the domain log

Reply Children
No Data