Connect salesforce to ftp using http request - ftp

I want to connect my salesforce account to an FTP server so that I do not have to use the local system for the storage of any files coming from FTP. I have tried connecting to the FTP server using CLI which I have done successfully as I can see the files coming from the FTP.
Can somebody explain how i ccould connect the ftp server to my salesforce account using an http request and also how could i transfer and use the .Csv file to update/import the data into the salesforce custom object**

There are many methods to import data into Salesforce, however, FTP to Salesforce isn't one of them. I would either use the Salesforce Data Loader, if you have access to this data at the console, or use the Salesforce API for whatever platform you program in, to create a program that uses your FTP and can parse your data and deliver it to Salesforce through the API.

You're not going to be able to do this directly. You might look at using an intermediary system like TIBCO or Informatica. SFDC specifically prohibits FTP access.
Using your staging system, have it kick off an Apex bulk API job to do the import. You could do it with a cheap cloud server running your FTP box and a script that kicks off when a file is created in the specified directory, and then when the API job is done, archive or delete the original file and log files.

Related

Copying data from on premises FTP to Azure storage with gateway/VPN and Logic apps/Functions

We have data on premises ftp server that I need to copy on schedule to Azure database. The ftp servers are behind NAT and can be reached from our on premises network. I have tried several things to copy the data:
1) Logic apps have ftp transfer option, but they don't support Data Management Gateway? How could I integrate VPN from onprem<->Azure with Logic Apps/Functions?
2) Azure Data Factory. This is not optimal, because I want to add ftp sources programmatically, but I tried this option to see if it works. I wasn't able to reach local ftp servers with Data Management Gateway. Probably because the NAT.
All suggestions how I should proceed with this would be greatly appreciated. Let me know if you need more info.
The scenario is:
-----------------------------------------
| Tosibox VPN | Azure VPN/Gateway |
-----------------------------------------
| ftp server | On prem | Azure |
-----------------------------------------
| 10.10.10.* | 192.168.75.* | 10.10.0.* |
-----------------------------------------
EDIT:
I still claim that Logic apps ftp-plugin doesn't work with on premises Data management gateway, so that doesn't go for an answer.
I tried to mount the ftp-server to my local windows machine and share that with file connector + data management gateway. However ftp-server mounts as a network drive and doesn't give local drive letter where file connector could connect out of the box. There is some hacks how one gets the drive letter and I was able to do that, but it didn't work other than the root ftp-folder.
I any case this would feel like unscalable hack, because I have several ftp-sources and in future might have alot more. I don't think there is easy way to get Logic apps/functions work with on premises ftp at the moment.
I think I am going to try to make VPN-gateway to on premises and copy the files using virtual machine/Web job.
I understand that FTP is boring and legacy, but still should be better supported from Microsoft imo. One more thing. In case you wonder why FTP and not something else, these are building automation controllers which support only FTP as output. So this is sort of IoT-case...
Why not use the File-connector which is supported by the Data Management Gateway and read from the underlying FTP-folders instead of using the FTP-connector?
Or are the FTP root folders not accessible from the machine on which you installed the gateway (by for example a fileshare) ?
FTP is not supported by Data Management Gateway, so if you want to connect to the FTP, it will need to be publicly available for your application to be able to make the FTP-connection.
With Azure Logic Apps, you can use on-premises data gateway to connect to on-premises systems, it supports FTP, or even just plain file share. Depending on which database you want to insert the data into, Logic Apps most likely also supports it - Cosmos Db, SQL, etc., and all are possible via designer without you having to write any code.
We used Function and VPN gateway in the end to fetch the FTP data. To use Function with VNET integration one needs to create the function with App Service Plan.

FTPS in Spring or Applet

I have a requirement to provide Secure-File-Upload file feature as a new service in my existing application. Expected Upload file size would be huge like over 100MB. If I do plugin-in such feature into my application it will surely die.
At the same time I need to provide or launch that service only through my current application, anyhow I need to achieve it without affecting my current application at any cost.
I am thinking of two solutions in mind, request others advise
Develop a small file uploader web app, host it in a seperate web/app severs,
launch it from my current application through some link. (I can not ask user to login into another new url)
Render an Applet to achieve secure file transfer service (in this point I am not clear whether the applet can directly talk to SFTP server without hindering
my current app's server components)
Further, I am referring to Spring Integration docs with FTP server.
I wonder Can a spring controller receive stream from client via FTPS connection and immediately transfer to FTP server without having to store it in local file.
Please advise your views.
Thanks&Regards,
Sabari

Is direct transfer from Dropbox to FTP possible?

Is there a way, to setup directl file transfer from Dropbox/Google Drive/OneDrive... to FTP server. Is it "physically" possible or/and does any API and programming logic even allow that?
No, Dropbox does not offer an FTP interface or functionality like this. Dropbox offers an HTTP based API:
https://www.dropbox.com/developers/core
You could use that API to programmatically download content from Dropbox, and then upload that to an FTP server, but that would require a client in the middle to manage the download and upload.

How to retrieve BDD & FTP informations in ISPConfig

I manage my websites with ISPConfig 3.0.4. This is a great tool but I have problems with the FTP and database manager :
I create a lot of site every day, and it's very annoying to type username and password every time, save and share them to my partners.
How to make FTP & BDD passwords automatically generated ?
There is a way to email me these ?
Probably by scripting database_edit.php and ftp_user_edit.php files ?
In short, I am looking for a way to facilitate these tasks.
You can make you own script to create FTP & BDD users and then sending an email directly.
ISPConfig 3 delivers a remote API using SOAP Protocol.
Check out the API documentation which is in PHP : Ispconfig-API-Doc
You just have to create a remote user in the ISPconfig Panel and then connect to your server with the API. Then use functions delivered by the API for each registration you want to do.
I created a wrapper in Python using the remote API : Ispconfig remote API Wrapper

Receive File via SFTP/SSH and automatically forward to FTP on another server

I'm currently in a situation where I receive flat files via FTP from my clients. A couple of clients have insisted on the need to use SSH Private Key SFTP rather than regular FTP.
What I want to do is setup a web server (preferably in linux/unix but I guess I can do it on a windows server and purchase SFTP server software) that will do the following:
Allow me to setup an SFTP directory for each client with unique user/pass. Each directory also has to have the public/private key SSH "stuff" I'm a little new to this but I've googled it.
Once the file is completely uploaded by the client, I want to kick off an event that ftp's that file via regular FTP to my Windows cloud.
These files can be up to 10mb so the even that ftp's to the other server can't fire until the file is completely uploaded.
Has anyone set something like this up? Any guidance would be appreciated.
Thanks!
In Linux, you can use incron to monitor the directory the files will be SFTP'd to and have it trigger your ftp job. It's kind of like cron except that instead of triggering jobs based on time, it does so based on filesystem modifications. In order to only trigger once the entire file has been written, I think you can use IN_CLOSE_WRITE in the inotify mask. Failing this, I suggest configuring events for each of the events individually to echo a message to a log file and see if you can identify one which reliably happens only at the end of the SFTP transfer.
If you're using RedHat, it's not in the standard distribution, but it is in EPEL.
On Windows you could use Titan FTP Server Enterprise Edition, which supports SFTP as well as allows you to define various types of events. When the event is triggered, you could kick off anything you need on a per folder/per account basis.
PS. AFAIK, when it comes to SFTP it is either password authentication or public key authentication (SSH key), but not both.
In your UNIX server, you can configure SSH to use a custom sftp server that instead of handling SFTP protocol itself, opens a new SSH connection to to the Windows SFTP server using password authentication and forwards the SFTP traffic there.
Writting the proxy is easy with the right tools, for instance, in Perl using the Net::OpenSSH module:
#!/usr/bin/perl
# this is the sftp-proxy-server
use Net::OpenSSH;
my $ssh = Net::OpenSSH->new($windows_server, $user, $passwd);
$ssh->system({ssh_opts => '-s'}, 'sftp');
$ssh->error and die $ssh->error;
You can instruct the SSH server to use that alternative SFTP server changing the configuration in /etc/ssh/sshd_config. For instance:
Subsystem sftp /usr/local/bin/sftp-proxy-server
Did you try apache FTP Serveur ?
I think you can do what you need with the ftplet API.
see :
http://mina.apache.org/ftpserver-project/index.html

Resources