Skip to content
⌘ NSIS Forum Archive

InetLoad FTP with Auth?

6 posts

nwphelps#

InetLoad FTP with Auth?

I have used InetLoad with lots of success for HTTP, however, I've run into a problem with FTP when using embedded authorization. I.E. ftp://username😛w@somehost.com/myfile.zip

I'm assuming this type of syntax is not supported. Can anyone confirm this? And if so, is there any way to do FTP that requires authorization?
ElvenProgrammer#
For server (http/ftp) authentication it is possible
to use URL encoded name and password, for example http://username😛assword@nsis.sourceforge.net
So I guess it is meant to work, maybe we have a bug here?
nwphelps#
!define DOWNLOAD_URL "ftp://myusername:mypassword@ftp.myco.com/myfile.zip"

DownloadFile:
InetLoad::load "${DOWNLOAD_URL}" "$TEMP\myfile.zip"
Pop $0
StrCmp $0 "OK" Finish Error

Error:
MessageBox MB_RETRYCANCEL|MB_ICONQUESTION|MB_DEFBUTTON1 "Download Error" /SD IDCANCEL IDRETRY DownloadFile
Abort

Finish:
Return

The above works fine when DOWNLOAD_URL is an FTP URL without credentials, but not when it includes the credentials.
Takhir#
If you remote server is Linux (UNIX) home folder for ftp connection may be defined for every user. Test it with full path on the remote filesystem ftp://username😛w@somehost.com/home/username/myfile.zip
(Retested with Linux and Free BSD - works fine in my LAN).