is it possible to upload files directly on a FTP Server?
If it is.. is there perhaps anywhere an example?
I've seen this installer but I don't now if that's NSIS:

Thank you 🙂
25 posts

Originally posted by Sp33dy G0nz4l3sWrong. According to that specific page of thread that I've linked to, it supports FTP upload. And if it doesn't support, or doesn't work, it still suggests an alternative of using ftp.exe from $SYSDIR with the -s switch for scripting.
The plugin inetc(lient) looks very good but this is only to download from a FTP. Right?
I've no idea how I can make no a custom page like in the picture I posted. So that the user can write the host... in a field and click after this on the connect button and choose the directory.inetc:😛ut /POPUP /CAPTION "my local ftp upload" "ftp://takhir😛wd@p320/m2.bu.jpg" "$EXEDIR\m2.jpg"
If you need recurcive scan - use forum search.
Name "Inetc Dir Scanner Test"
OutFile "scanner.exe"
!include "MUI.nsh"
!insertmacro MUI_PAGE_INSTFILES
!insertmacro MUI_LANGUAGE "English"
!include "FileFunc.nsh"
!insertmacro GetFileAttributes
Section "Dummy Section" SecDummy
FindFirst $0 $1 "$EXEDIR\*"
loop:
StrCmp $1 "" done
${GetFileAttributes} "$EXEDIR\$1" DIRECTORY $2
IntCmp $2 1 cont
Inetc:😛ut ftp://*********.com/$1 "$EXEDIR\$1"
Pop $3
DetailPrint "$1 $3"
cont:
FindNext $0 $1
Goto loop
done:
SetDetailsView show
SectionEnd
The upload is always shown in the popup window. When I close now this popup window (cancel the upload) normally the MessageBox Upload Status: terminated should be shown and the upload should be terminated.
;--------------------------------
; General Attributes
Name "Inetc Test"
OutFile "put.exe"
;--------------------------------
;Interface Settings
!include "MUI.nsh"
!define MUI_ICON "${NSISDIR}\Contrib\Graphics\Icons\modern-install-colorful.ico"
!insertmacro MUI_PAGE_INSTFILES
!insertmacro MUI_LANGUAGE "English"
!include "FileFunc.nsh"
!insertmacro GetFileAttributes
;--------------------------------
;Installer Sections
Section "Dummy Section" SecDummy
SetOutPath "$PROGRAMFILES\TEST"
File "Test1.txt"
File "Test2.txt"
SetOutPath "$PROGRAMFILES\TEST\TEST"
File "TEST\Test3.txt"
FindFirst $0 $1 "$PROGRAMFILES\TEST\*"
loop:
StrCmp $1 "" done
${GetFileAttributes} "$PROGRAMFILES\TEST\$1" DIRECTORY $2
IntCmp $2 1 cont
Inetc:😛ut /POPUP /CAPTION "my local ftp upload" "ftp://*********.com/html/$1" "$PROGRAMFILES\TEST\$1"
cont:
FindNext $0 $1
Goto loop
done:
Pop $3 # return value = exit code, "OK" if OK
MessageBox MB_OK "Upload Status: $3"
SectionEnd
Pop $3
StrCmp $3 "OK" cont
MessageBox MB_YESNO "Download failed/terminated. Continue?" IDYES cont
Abort "Terminated by user"
cont:
Now the installer should also upload all files from the folder $PROGRAMFILES\TEST\TEST how must I change/extend the code that he do this? I tried a lot of things but nothing has work:Section "Dummy Section" SecDummy
SetOutPath "$PROGRAMFILES\TEST"
File "Test1.txt"
File "Test2.txt"
SetOutPath "$PROGRAMFILES\TEST\TEST"
File "TEST\Test3.txt"
FindFirst $0 $1 "$PROGRAMFILES\TEST\*"
loop:
StrCmp $1 "" done
${GetFileAttributes} "$PROGRAMFILES\TEST\$1" DIRECTORY $2
IntCmp $2 1 cont
Inetc:😛ut /POPUP /CAPTION "my local ftp upload" "ftp://*********.com/html/$1" "$PROGRAMFILES\TEST\$1"
Pop $3
StrCmp $3 "OK" cont
MessageBox MB_YESNO "Download failed/terminated. Continue?" IDYES cont
Abort "Terminated by user"
cont:
FindNext $0 $1
Goto loop
done:
SectionEnd
Thanks for your helpSection "Dummy Section" SecDummy
SetOutPath "$PROGRAMFILES\TEST"
File "Test1.txt"
File "Test2.txt"
SetOutPath "$PROGRAMFILES\TEST\TEST"
File "TEST\Test3.txt"
FindFirst $0 $1 "$PROGRAMFILES\TEST\*"
loop:
StrCmp $1 "" done
${GetFileAttributes} "$PROGRAMFILES\TEST\$1" DIRECTORY $2
IntCmp $2 1 cont
Inetc:😛ut /POPUP /CAPTION "my local ftp upload" "ftp://*********.com/html/$1" "$PROGRAMFILES\TEST\$1"
Pop $3
StrCmp $3 "OK" cont
MessageBox MB_YESNO "Download failed/terminated. Continue?" IDYES cont
Abort "Terminated by user"
cont:
FindNext $0 $1
Goto loop
done:
FindFirst $4 $5 "$PROGRAMFILES\TEST\TEST\*"
loop:
StrCmp $5 "" done
${GetFileAttributes} "$PROGRAMFILES\TEST\TEST\$5" DIRECTORY $6
IntCmp $6 5 cont
Inetc:😛ut /POPUP /CAPTION "my local ftp upload" "ftp://*********.com/html/TEST/$5" "$PROGRAMFILES\TEST\TEST\$5"
Pop $7
StrCmp $7 "OK" cont
MessageBox MB_YESNO "Download failed/terminated. Continue?" IDYES cont
Abort "Terminated by user"
cont:
FindNext $4 $5
Goto loop
done:
SectionEnd
Section "Dummy Section" SecDummy
SetOutPath "$PROGRAMFILES\TEST"
File "Test1.txt"
File "Test2.txt"
SetOutPath "$PROGRAMFILES\TEST\TEST"
File "TEST\Test3.txt"
FindFirst $0 $1 "$PROGRAMFILES\TEST\*"
loop:
StrCmp $1 "" done
${GetFileAttributes} "$PROGRAMFILES\TEST\$1" DIRECTORY $2
IntCmp $2 1 cont
Inetc:ut /POPUP /CAPTION "my local ftp upload" "ftp://*********.com/html/$1" "$PROGRAMFILES\TEST\$1"
Pop $3
StrCmp $3 "OK" cont
MessageBox MB_YESNO "Download failed/terminated. Continue?" IDYES cont
Abort "Terminated by user"
cont:
FindNext $0 $1
Goto loop
done:
FindClose $0
FindFirst $4 $5 "$PROGRAMFILES\TEST\TEST\*"
loop2:
StrCmp $5 "" done2
${GetFileAttributes} "$PROGRAMFILES\TEST\TEST\$5" DIRECTORY $6
IntCmp $6 5 cont2
Inetc:ut /POPUP /CAPTION "my local ftp upload" "ftp://*********.com/html/TEST/$5" "$PROGRAMFILES\TEST\TEST\$5"
Pop $7
StrCmp $7 "OK" cont2
MessageBox MB_YESNO "Download failed/terminated. Continue?" IDYES cont2
Abort "Terminated by user"
cont2:
FindNext $4 $5
Goto loop2
done2:
FindClose $4
SectionEnd
.. but when I start the installer I get always an error and in the details is the following text:Section "Dummy Section" SecDummy
SetDetailsView hide
StrCpy $path "$PROGRAMFILES\TEST"
StrCpy $url ftp://username😛w@server.com/html
Call dirul
SetDetailsView show
SectionEnd
Edited: forum' php added [url] to my script too 🙂 BTW I don't see 401 in the ftp error codes - please check url correctness, plug-in threats it as http. I can test it again in office tomorrow.
StrCpy $url ftp://username😛wd@server.com/html
I've try the url with the "original" code and there it works.ftp://web4😛wd@web254.billhost.de/html
but current plug-in version not creates sub-directories on the ftp server, so folder must exist for this version.
Push $path
Push $url
StrCpy $path "$path\$1"
StrCpy $url "$url/$1"
Call dirul
Pop $url
Pop $path