Directorio y descarga mediante SFTP
Moderator: Rathinagiri
- edufloriv
- Posts: 238
- Joined: Thu Nov 08, 2012 3:42 am
- DBs Used: DBF, MariaDB, MySQL, MSSQL, MariaDB
- Location: PERU
Directorio y descarga mediante SFTP
Saludos amigos,
¿ Alguien tiene código fuente para obtener el directorio y descargar archivos mediante SFTP usando key (SSH) ? Ya puedo subir archivos, pero he buscado en la red y no encuentro los comandos para obtener el directorio y descargar.
Agradeceré su ayuda por favor. Mil gracias anticipadas.
Greetings, friends
Does anyone have source code to get the directory and download files using SFTP using key (SSH)? I can upload files, but I searched the network and can not find the commands to obtain the directory and download.
I will appreciate your help please. Many thanks in advance.
Att.
¿ Alguien tiene código fuente para obtener el directorio y descargar archivos mediante SFTP usando key (SSH) ? Ya puedo subir archivos, pero he buscado en la red y no encuentro los comandos para obtener el directorio y descargar.
Agradeceré su ayuda por favor. Mil gracias anticipadas.
Greetings, friends
Does anyone have source code to get the directory and download files using SFTP using key (SSH)? I can upload files, but I searched the network and can not find the commands to obtain the directory and download.
I will appreciate your help please. Many thanks in advance.
Att.
Eduardo Flores Rivas
LIMA - PERU
- dragancesu
- Posts: 921
- Joined: Mon Jun 24, 2013 11:53 am
- DBs Used: DBF, MySQL, Oracle
- Location: Subotica, Serbia
Re: Directorio y descarga mediante SFTP
Windows has a built-in ftp client that is not for serious use
In applications that need to send / receive data via ftp companies we use the program ncftp as an external solution, it is not perfect, but it has everything
there are several programs, one is ncftpls that serves to output the contents of a folder, then it is easy to redirect it to a file, this is our solution
Try
https://www.ncftp.com/ncftp/
or
https://winscp.net/eng/docs/commandline
In applications that need to send / receive data via ftp companies we use the program ncftp as an external solution, it is not perfect, but it has everything
there are several programs, one is ncftpls that serves to output the contents of a folder, then it is easy to redirect it to a file, this is our solution
Try
https://www.ncftp.com/ncftp/
or
https://winscp.net/eng/docs/commandline
Last edited by dragancesu on Mon Oct 15, 2018 8:28 pm, edited 1 time in total.
- edufloriv
- Posts: 238
- Joined: Thu Nov 08, 2012 3:42 am
- DBs Used: DBF, MariaDB, MySQL, MSSQL, MariaDB
- Location: PERU
Re: Directorio y descarga mediante SFTP
Thank you very much, I will try both, thanks for your answer.
Muchas gracias, probaré ambos, gracias por tu respuesta.
Att.
Muchas gracias, probaré ambos, gracias por tu respuesta.
Att.
Eduardo Flores Rivas
LIMA - PERU
Re: Directorio y descarga mediante SFTP
Hola Eduardo Flores.edufloriv wrote: ↑Thu Oct 11, 2018 5:52 pm Greetings, friends
Does anyone have source code to get the directory and download files using SFTP using key (SSH)? I can upload files, but I searched the network and can not find the commands to obtain the directory and download.
I will appreciate your help please. Many thanks in advance.
Check out this sample simple application to navigate on an SFTP server.
It only supports basic functions:
- listing of folders / files of local disks and a remote host
- navigating local and remote folders
- copying files (one at a time) from a local disk to a remote folder (upload)
- copying files (one at a time) from a remote folder to a local drive (download)
- renaming files / folders on local disks and on a remote host
- creating folders on local disks and on a remote host
- deleting files and folders from local drives and from a remote host
I tested with a local SFTP server (Bitvise SSH Server 7.46) and with a demo public sftp server: sftp://demo.wftpserver.com/
Authorization with a username and password. I can not authorize using a Public / Private key pair (maybe I have generated it incorrectly or I can not configure it properly, I have no experience with this).
Cheers.
Re: Directorio y descarga mediante SFTP
Small improvements:
- when changing the folder to the parent, the active row is set to the name of the folder that you left.
- when adding a new folder, the active row is set on the created folder
- when deleting a file or folder, the active row remains in the nearest position of the deleted item.
- go to the parent folder with the BACKSPACE key.
- when changing the folder to the parent, the active row is set to the name of the folder that you left.
- when adding a new folder, the active row is set on the created folder
- when deleting a file or folder, the active row remains in the nearest position of the deleted item.
- go to the parent folder with the BACKSPACE key.
- vientopamperosur
- Posts: 59
- Joined: Thu Aug 28, 2014 10:13 am
- DBs Used: DBF, SQLite, MySQL, MariaDB, PostgreSQL
- Location: Buenos Aires
- Contact:
Re: Directorio y descarga mediante SFTP
Buenas compañeros, estoy interesado en probar este ejemplo, pero no puedo compilarlo para estudiarlo, me falta hbcurl.ch, Donde puedo conseguir este archivo?
Re: Directorio y descarga mediante SFTP
To properly compile you should have the HMG 3.4.4 version installed
Then, from this package: http://hmgforum.com/download/file.php?id=8685 copy all files from the "lib" folder to "c:\hmg.3.4.4\HARBOUR\lib\win\mingw"
You compile by running "build_SFTP.bat" (we compile sftp.hbp not sftp.prg)
The hbcurl.ch file should be in "c:\hmg.3.4.4\HARBOUR\contrib\hbcurl\"
Then, from this package: http://hmgforum.com/download/file.php?id=8685 copy all files from the "lib" folder to "c:\hmg.3.4.4\HARBOUR\lib\win\mingw"
You compile by running "build_SFTP.bat" (we compile sftp.hbp not sftp.prg)
The hbcurl.ch file should be in "c:\hmg.3.4.4\HARBOUR\contrib\hbcurl\"
Re: Directorio y descarga mediante SFTP
excellent sample!edk wrote: ↑Fri Oct 26, 2018 9:34 am Small improvements:
- when changing the folder to the parent, the active row is set to the name of the folder that you left.
- when adding a new folder, the active row is set on the created folder
- when deleting a file or folder, the active row remains in the nearest position of the deleted item.
- go to the parent folder with the BACKSPACE key.
sftp.7z
thanks for sharing
regards,
Pete
- vientopamperosur
- Posts: 59
- Joined: Thu Aug 28, 2014 10:13 am
- DBs Used: DBF, SQLite, MySQL, MariaDB, PostgreSQL
- Location: Buenos Aires
- Contact:
Re: Directorio y descarga mediante SFTP
Muchas gracias, voy a probarlo!
- vientopamperosur
- Posts: 59
- Joined: Thu Aug 28, 2014 10:13 am
- DBs Used: DBF, SQLite, MySQL, MariaDB, PostgreSQL
- Location: Buenos Aires
- Contact:
Re: Directorio y descarga mediante SFTP
Buen día. Sigo teniendo problemas...
Harbour 3.2.0dev (r1703241902)
Copyright (c) 1999-2016, http://harbour-project.org/
C:/Users/ale/AppData/Local/Temp/hbmk_zigy1s.dir/sftp.o:sftp.c:(.data+0x3d8): undefined reference to `HB_FUN_CURL_EASY_INIT'
C:/Users/ale/AppData/Local/Temp/hbmk_zigy1s.dir/sftp.o:sftp.c:(.data+0x3f8): undefined reference to `HB_FUN_CURL_EASY_RESET'
C:/Users/ale/AppData/Local/Temp/hbmk_zigy1s.dir/sftp.o:sftp.c:(.data+0x418): undefined reference to `HB_FUN_CURL_EASY_PERFORM'
C:/Users/ale/AppData/Local/Temp/hbmk_zigy1s.dir/sftp.o:sftp.c:(.data+0x438): undefined reference to `HB_FUN_CURL_EASY_STRERROR'
C:/Users/ale/AppData/Local/Temp/hbmk_zigy1s.dir/sftp.o:sftp.c:(.data+0x488): undefined reference to `HB_FUN_CURL_GLOBAL_CLEANUP'
C:/Users/ale/AppData/Local/Temp/hbmk_zigy1s.dir/sftp.o:sftp.c:(.data+0x498): undefined reference to `HB_FUN_CURL_EASY_ESCAPE'
C:/Users/ale/AppData/Local/Temp/hbmk_zigy1s.dir/sftp.o:sftp.c:(.data+0x4a8): undefined reference to `HB_FUN_CURL_EASY_SETOPT'
collect2.exe: error: ld returned 1 exit status
hbmk2[sftp]: Error: Ejecutando enlazador. 1
gcc.exe C:/Users/ale/AppData/Local/Temp/hbmk_zigy1s.dir/sftp.o C:/Users/ale/AppData/Local/Temp/hbmk_zigy1s.dir/hbmk_3nzs0n.o C:/HMGSQL/Ejemplos/sftp/SFTP_Navigator/_temp.o -mwindows -Wl,--start-group -lhmg -lcrypt -ledit -leditex -lgraph -lini -lreport -lhfcl -lmsvfw32 -lvfw32 -lhbmysql -lmysql -lhbfimage -lhbpgsql -lsddmy -lhbvpdf -lhbct -lhbwin -lhbmzip -lminizip -lhbmemio -lhbmisc -lhbtip -lsqlite3 -lhbsqlit3 -lsddodbc -lrddsql -lhbodbc -lodbc32 -lhbhpdf -lhbnetio -lxhb -lpng -llibhpdf -lhbzebra -lhbextern -lhbdebug -lhbvmmt -lhbrtl -lhblang -lhbcpage -lgtcgi -lgtpca -lgtstd -lgtwin -lgtwvt -lgtgui -lhbrdd -lhbuddall -lhbusrrdd -lrddntx -lrddcdx -lrddnsx -lrddfpt -lhbrdd -lhbhsx -lhbsix -lhbmacro -lhbcplr -lhbpp -lhbcommon -lhbmainwin -lkernel32 -luser32 -lgdi32 -ladvapi32 -lws2_32 -liphlpapi -lwinspool -lcomctl32 -lcomdlg32 -lshell32 -luuid -lole32 -loleaut32 -lmpr -lwinmm -lmapi32 -limm32 -lmsimg32 -lwininet -lhbpcre -lhbzlib -Wl,--end-group -o"SFTP Navigator.exe" -Lc:/hmg.3.4.4/harbour/lib/win/mingw -Lc:/hmg.3.4.4/lib
hbmk2: Sugerencia: A¤ade la opci¢n 'hbcurl.hbc' para las funciones que faltan:
curl_easy_setopt(), curl_easy_escape(), curl_global_cleanup(),
curl_easy_strerror(), curl_easy_perform(), curl_easy_reset(),
curl_easy_init()
he hecho todo lo indicado y me aparece este texto en build.log. Que estoy haciendo mal???
Harbour 3.2.0dev (r1703241902)
Copyright (c) 1999-2016, http://harbour-project.org/
C:/Users/ale/AppData/Local/Temp/hbmk_zigy1s.dir/sftp.o:sftp.c:(.data+0x3d8): undefined reference to `HB_FUN_CURL_EASY_INIT'
C:/Users/ale/AppData/Local/Temp/hbmk_zigy1s.dir/sftp.o:sftp.c:(.data+0x3f8): undefined reference to `HB_FUN_CURL_EASY_RESET'
C:/Users/ale/AppData/Local/Temp/hbmk_zigy1s.dir/sftp.o:sftp.c:(.data+0x418): undefined reference to `HB_FUN_CURL_EASY_PERFORM'
C:/Users/ale/AppData/Local/Temp/hbmk_zigy1s.dir/sftp.o:sftp.c:(.data+0x438): undefined reference to `HB_FUN_CURL_EASY_STRERROR'
C:/Users/ale/AppData/Local/Temp/hbmk_zigy1s.dir/sftp.o:sftp.c:(.data+0x488): undefined reference to `HB_FUN_CURL_GLOBAL_CLEANUP'
C:/Users/ale/AppData/Local/Temp/hbmk_zigy1s.dir/sftp.o:sftp.c:(.data+0x498): undefined reference to `HB_FUN_CURL_EASY_ESCAPE'
C:/Users/ale/AppData/Local/Temp/hbmk_zigy1s.dir/sftp.o:sftp.c:(.data+0x4a8): undefined reference to `HB_FUN_CURL_EASY_SETOPT'
collect2.exe: error: ld returned 1 exit status
hbmk2[sftp]: Error: Ejecutando enlazador. 1
gcc.exe C:/Users/ale/AppData/Local/Temp/hbmk_zigy1s.dir/sftp.o C:/Users/ale/AppData/Local/Temp/hbmk_zigy1s.dir/hbmk_3nzs0n.o C:/HMGSQL/Ejemplos/sftp/SFTP_Navigator/_temp.o -mwindows -Wl,--start-group -lhmg -lcrypt -ledit -leditex -lgraph -lini -lreport -lhfcl -lmsvfw32 -lvfw32 -lhbmysql -lmysql -lhbfimage -lhbpgsql -lsddmy -lhbvpdf -lhbct -lhbwin -lhbmzip -lminizip -lhbmemio -lhbmisc -lhbtip -lsqlite3 -lhbsqlit3 -lsddodbc -lrddsql -lhbodbc -lodbc32 -lhbhpdf -lhbnetio -lxhb -lpng -llibhpdf -lhbzebra -lhbextern -lhbdebug -lhbvmmt -lhbrtl -lhblang -lhbcpage -lgtcgi -lgtpca -lgtstd -lgtwin -lgtwvt -lgtgui -lhbrdd -lhbuddall -lhbusrrdd -lrddntx -lrddcdx -lrddnsx -lrddfpt -lhbrdd -lhbhsx -lhbsix -lhbmacro -lhbcplr -lhbpp -lhbcommon -lhbmainwin -lkernel32 -luser32 -lgdi32 -ladvapi32 -lws2_32 -liphlpapi -lwinspool -lcomctl32 -lcomdlg32 -lshell32 -luuid -lole32 -loleaut32 -lmpr -lwinmm -lmapi32 -limm32 -lmsimg32 -lwininet -lhbpcre -lhbzlib -Wl,--end-group -o"SFTP Navigator.exe" -Lc:/hmg.3.4.4/harbour/lib/win/mingw -Lc:/hmg.3.4.4/lib
hbmk2: Sugerencia: A¤ade la opci¢n 'hbcurl.hbc' para las funciones que faltan:
curl_easy_setopt(), curl_easy_escape(), curl_global_cleanup(),
curl_easy_strerror(), curl_easy_perform(), curl_easy_reset(),
curl_easy_init()
he hecho todo lo indicado y me aparece este texto en build.log. Que estoy haciendo mal???