Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Exporting data to FTP site

Featured Replies

Hi there,

I want to export an excel file to an FTP site in a script, but I want to be able to login automatically. what is the best way to do this?

Also I know I can use the open Url script step or set Web Viewer to open a URL site, how can I log in automatically without having to prompt users for username and password each time? can I paste the username and password in the fields automatically and automatically login?

Thanks

You'd probably export the file, then run an OS level script that does the ftp-ing.

  • Author

Hi Vaughan,

Thanks for your response, sorry I am new at this, I am using windows, can you please tell me which script step to use? and give me an example of logging into the ftp automatically?

Thanks

  • Author

Is there no way to dump a file on a ftp site without a plugin?

For Windows only, if you don't want to use a plugin, you can use send event, open document/application, and set parameter to:

"CMD /C echo username> C:ftpcmd.dat&echo password>> C:ftpcmd.dat&echo bin>> C:ftpcmd.dat& echo cd httpdocs>> C:ftpcmd.dat&echo put " & "filename" & ">> C:ftpcmd.dat&echo quit>> C:ftpcmd.dat"

This will create a file ftpcmd.dat, containing your ftp credentials, a change directory command to go to httpdocs, and put a single file to the server. You can add additional commands as needed using echo. Change cd command and filename as appropriate.

To run this command file, execute another send event

"cmd /C ftp -d -s:C:ftpcmd.dat ftp.yoursite.com"

In Windows, the built-in ftp command can't accept credentials directly from the command line, but it can accept them from a file. If you enter ftp /? from dos prompt it will show parameter list.

One advantage to this method is that it will run concurrently with FM so FM won't be held up as file uploads; if you later need to check if it succeeded you can write standard output to a file and bring it back into Filemaker.

If you install cURL on Windows, it will accept credentials directly from the command line, and

send event

"CMD /C C:CURLcurl -u username:password -T C:filename.html ftp.yoursite.com/httpdocs/remotefilename.html -w "

will do the trick

The free Mooplug plugin will upload to ftp sites.

On second question, login to sites with basic authentication may be achieved with http://username:[email protected]

In newer versions of IE,this isn't supported per http://support.microsoft.com/kb/834489 in which case, you can use a javascript to login/post the necessary form data.

Change above to cmd /k while debugging; this will leave DOS windows up after command executes so you can examine results. /c closes window after termination.

Edited by Guest

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.