NickLightbody

FTP uploads from Filemaker

Discussion created by NickLightbody on Oct 18, 2015
Latest reply on Oct 4, 2016 by NickLightbody

I am currently polishing a solution, originally it was just a small idea, which has appeared quite useful, into an App.

 

It is called rwApp and it generates a Responsive Web site from simple textual input, with some use of Markdown and a few codes.

 

I have explained what it is and why here

 

http://www.deskspace.com/rwapp_features.html

 

In refining it I have created a few sites recently which give an idea of what it can do:

 

   http://www.deskspace.com

   http://www.nicklightbody.com

   http://www.deskspace.com/t/ionian/index.html

   http://www.bolnore.com/t/beijing/index.html

   http://www.bolnore.com/t/trialno1/

 

The last is made entirely on an iPhone.

 

If anyone wishes to volunteer to review the rwApp, and get a free license after release, please let me know. You can email me on nick.lightbody@deskspace.com

 

The challenge was how to ftp the new pages up to the web server automatically from OS X 10.11. I had been manually dragging them into an ftp window and over Sunday lunch my wife suggested that this really was not good enough!

 

A little searching showed several people (bigtom springs to mind) had shared their knowledge of doing uploading with ftp with an expression creating an Applescript which itself used Curl to achieve the ftp - but after several hours effort I couldn't get the upload to work.

 

Then I found a brilliant thread

 

http://comments.gmane.org/gmane.comp.web.curl.general/5634

 

which provided the syntax for Curl to report back all its environmental values on receipt of the command, which revealed that a $1 within the ftp password was disappearing within the Applescript, hence my authentication was failing. So I changed the password to not inc a $ character and it worked as expected. I imagine I could have escaped it somehow?

 

Here is the brilliant Curl command to be run in Terminal:

 

A Terminal Command $               curl --trace -n -v -ssl -l ftp://<username>:<password>@<svr IP address>/<folder>/<file.html>

 

This gave the following report back to help me solve the issue - with explicit details of the username and password received:

 

Warning: -v, --verbose overrides an earlier trace/verbose option

*   Trying 193.xxx.xxx.xxx..

* Connected to 193.xxx.xxx.xxx (193.xxx.xxx.xxx) port 21 (#0)

< 220 ProFTPD 1.3.5a Server (ProFTPD) [193.xxx.xxx.xxx]

> USER xxxxxxxx-ftp

< 331 Password required for xxxxxxxx-ftp

> PASS abcdef

< 530 Login incorrect.

* Access denied: 530

* Closing connection 0

 

In this case the password input would have been abc$1def and only the abcdef survived the Applescript.

 

The final Applescript looked like this:

 

do Applescript curl -T '/private/var/folders/65/g9tpm0qs5tg1rbxf6s25z2wm0000gn/T/S10/index.html' ftp://user-ftp:password@193.xxx.xxx.xxx/httpdocs/index.html

 

The expression itself is of course in quotes, hence the use of single quotes around the source file.

 

So I was just exporting my string as an html file to get(temporary path) and then immediately using curl to ftp from that temp folder to the web server.

 

Very fast.

 

The only point to watch, besides the $ business, is that there were some comments that this may work better using the server IP rather than the domain name, so that is what I did, logically an IP should be better I would think since it is a real address rather than a user friendly label which is all a domain name is.

 

Cheers, Nick

Outcomes