Download Button

8 views
Skip to first unread message

mahemoff

unread,
Sep 10, 2009, 5:50:16 PM9/10/09
to TiddlyWikiDev
I'm wondering how to emulate the Download button on TiddlyWiki.com for
my own TiddlyWiki verticals, where I've started by downloading
TiddlyWiki and then customised it in some way (by adding plugins or
maybe just by adding content).

As a related question, what exactly does the Download button do that
"Save Page" doesn't? I've heard it's do with browsers saving current
DOM state instead of the initial page HTML, but I'm not sure if that's
the case and which browsers are affected. Presumably, I can't just put
up my vertical on a server and tell people to "Save Page" - if it
doesn't work for empty tiddlywiki, I presume it won't work for my
vertical either.

Eric Shulman

unread,
Sep 10, 2009, 10:27:32 PM9/10/09
to TiddlyWikiDev
> As a related question, what exactly does the Download button do that
> "Save Page" doesn't?

TiddlyTools' #QuickStart uses 'download' links that let you *left*
click on the link to immediately initiate a browser-based 'download-
and-save' dialog box interaction.

To do this, I wrote a small PHP script that lives on the
tiddlytools.com server. You can get a copy from this link:
http://www.TiddlyTools.com/download.php?file=download.php

URL syntax is:
http://.../download.php?file=path/to/filename.ext

For example:
http://.../download.php?file=quickstart/tiddlyblog.html

enjoy,
-e

FND

unread,
Sep 12, 2009, 8:25:28 AM9/12/09
to tiddly...@googlegroups.com
> I'm wondering how to emulate the Download button on TiddlyWiki.com for
> my own TiddlyWiki verticals

We use the following PHP script to force the download dialog:
http://trac.tiddlywiki.org/browser/Trunk/verticals/tiddlywiki.com/empty.download

The actual button is generated with this client-side plugin:
http://trac.tiddlywiki.org/browser/Trunk/verticals/tiddlywiki.com/plugins/DownloadTiddlyWikiPlugin.js

> As a related question, what exactly does the Download button do that
> "Save Page" doesn't? I've heard it's do with browsers saving current
> DOM state instead of the initial page HTML

That's right. I think it's Firefox is doing that, but don't remember
which other browsers were affected as well.


-- F.

Eric Shulman

unread,
Sep 12, 2009, 9:46:15 AM9/12/09
to TiddlyWikiDev
> We use the following PHP script to force the download dialog:http://trac.tiddlywiki.org/browser/Trunk/verticals/tiddlywiki.com/emp...

Note that the above PHP script is nearly the same as
http://www.TiddlyTools.com/download.php

except that the TiddlyTools script accepts a filename as a URL
parameter instead of using a hard-coded 'empty.html', and also forces
no caching via Pragma and "Cache-content" headers. There *is* one
thing that the TW.com script does that TiddlyTools doesn't (currently)
do: it sets the "Content-length" header to the actual # of bytes being
sent.

-e


Reply all
Reply to author
Forward
0 new messages