Skip to content
⌘ NSIS Forum Archive

FTP: how to upload file to the server under subdir

12 posts

atsuk#

FTP: how to upload file to the server under subdir

hey,
i'm using ftpul.dll. upload generally works, but when i try to upload file under subdirectory it fails. and subfolder was already created.

and maybe someone can tell me how to check for existance of file in server.

any idea?
Yathosho#
a line from a script using the FTPul plugin.
FTPul::upload "$FTP/$File" '$LocalDirectory\$File' $Login $Password"
dont see a reason, why uploading to subdirs shouldnt work, never had any problems. you using the ftp:// prefix?

using curl could be a solution for your second question.
atsuk#
i used this syntax:

FTPdl::download "ftp://www.zone.ee/vk/Evarukoopia.zip" "E:\Evarukoopia.zip" atsuktrp trp2E1 
and it didn't work... user name and passwords are correct, you can try by yourself
atsuk#
ooops:$
i used variables, and really missed that backslash 😁
tnx

but can you tell me
how to check for existance of file in server.
and how to create subdirectory to the server.
zimsms#
but can you tell me how to check for existance of file in server.
Doesn't one of the ftp plugin return codes tell you if the file you are trying to download didn't exist? In that case it would be simple. Simply try to download the file if it fails and the return code is ? , then obviously the file doesn't exist.

As for your second question FTP supports the mkdir command. I'm not sure if the plugin does though.....As Yathosho suggested Curl will work.
atsuk#
yes, trying to download is really one solution, but immagine that the file can be 10MB or even more...it would take a lot of time.
tnx
VegetaSan#
where did you get that plugin . I cant find it on the archive .. do you mind attaching it .. merci 😁
atsuk#
when subfolder doesn't exist it will abort upload.

plugin can be found from this page:
Are you a developer who uses NSIS to distribute your application? Are you a Winamp plug-in developer who wants to use NSIS to distribute your plug-in? Have suggestions for other people like you? This is the place.
mumuri#edited
ok i will have to use curl to create folder, thanks or i can use ftp.exe in windows folders too