On Sep 3, 8:46 am, pixelwax <
pixel...@gmail.com> wrote:
> Hello,
>
> I'm having troubles with multiple TWs when trying to upload from local
> to remote. Each TiddlyWiki is defaulting to the same set of
> UploadOptions across all TWs regardless of the TW in use. It appears
> that the cookie name is the culprit but before I go about hacking all
> the Upload plugin Tiddlers to use unique cookie names (based upon the
> my tiddly's filename, e.g. txtUploadStoreUrlMyTiddly,
> txtUploadUserNameMyTiddly, txtUploadFilenameMyTiddly, and whatever
> other cookies are involved...), I'd like to know if there is something
> simpler for me to try. Is there?
Try this:
Create a [[CookieJar]] tiddler, tagged with systemConfig, containing
the following lines of javascript code:
config.options.txtUploadStoreUrl="
http://www.example.com/path/to/
store.php";
config.options.txtUploadDir="path/to/document/"
config.options.txtUploadFilename=null;
config.options.txtUploadBackupDir="backup";
These statements assign hard-coded settings (a.k.a 'baked cookies')
for various options used by the <<upload>> macro. If you add this
tiddler into each of your documents, you can then easily reconfigure
each document to have different settings to suit your particular
purposes.
Also, by using a CookieJar to associate hard-coded values with the
document itself rather than being stored as browser cookies, when you
view your document from another browser or system, the upload settings
for the document will still be correctly applied, even though the
browser you are using at the time almost certainly doesn't have any of
the proper cookie values defined.
Some points of note:
* The store URL is an absolute reference. Only one copy of the
store.php script is needed for any given domain, regardless of the
folder locations into which individual TW documents are uploaded.
* the upload directory is the *path* in which the specific TW document
will be placed. If you set it to null, it will default to the same
folder as the store.php script.
* the upload filename is generally set to null so that the *filename*
used online will default to the same as the document currently loaded
in the browser.
* the backup directory is specified without a leading "/", so that
backup folders will be created in each individual directory for which
you have uploaded a TW document. It is also possible to define an
*absolute* path (i.e., with a leading "/") to use a single, shared
backup directory so that all your TW documents can write their backup
files to the same location on your server. This ability can be very
useful, but may also create confusion if you have documents in several
different folders that all have the same name (e.g., multiple
instances of "index.html")
see also:
http://www.TiddlyTools.com/#CookieManagerPlugin
http://www.TiddlyTools.com/#FAQ_OverrideOptions
enjoy,
-e
Eric Shulman
TiddlyTools / ELS Design Studios