Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

This topic is 5191 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

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

Posted

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

Posted

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

Posted (edited)

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

This topic is 5191 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

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