Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Upload files to Secure FTP Server?
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9 SP2
Divers
Thread ID:
01504424
Message ID:
01504429
Vues:
124
I battled this problem a few months ago. The solution I finally came up with was to use WinSCP and it's built-in scripting language to do it.

http://winscp.net/eng/index.php

Obviously the tricky part is coming up with the script - which will look something like this:

option batch on
option confirm off
open username:password@hostname.org
cd /ftp/myFTPdir/
option transfer binary
get -delete renamed_download_filename.txt downloadfilename.sdf
close
exit

...and that needs to be in a txt file - then you run the .txt file with a .bat file

winscp /console /script=theabovescript_Script.txt /log=wlog.txt
if errorlevel 1 goto error
echo Success
Del failed.flg
goto end
:error
echo Error!
Del Success.flg
:end

...so what I've done is:
1. In my VFP application, create the above .txt and .bat files
2. Create 2 other files - failed.flg and success.flg
3. Run the .bat file from VFP via shellexecute
4. Too see if it worked check which of the two .flg files got deleted.

...not the cleanest implementation I've ever done - but hey it works and WinSCP is free.

Only other tricky thing is how your sFTP handles the certificates...for me I have to run WinSCP and connect to the sFTP once on the user's workstation to get the certificate prior to user's being able to use it.


>Hello all and thanks for your help!!!!
>
>I need to upload a text file to a secure FTP server, I've been using a DLL from MarshalSoft.com that works well but not with secure FTP connections, is there any code that I can use to upload files to a secure ftp server? This is very important, any help will be greatly appreciated!
>
>Thanks again,
>
>Juan Urbina
ICQ 10556 (ya), 254117
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform