Announcing File Uploads - TiddlyServer 2.0.12

418 views
Skip to first unread message

Arlen Beiler

unread,
Mar 7, 2018, 9:09:51 AM3/7/18
to TiddlyWiki
Hello Everyone, 

I'm pleased to announce a new release of TiddlyServer that now supports file uploads to the directory you are currently browsing. Scroll to the bottom of the directory index page and you will see an upload area.

Beware that uploading a tiddlywiki.info file to any directory will immediately make it inaccessible and turn it into a TiddlyWiki data folder. The only way to fix this is to delete or rename the tiddlywiki.info file. The folder should not be affected otherwise, except it will probably have a tiddlers folder created inside it. 

So if you want to make a data folder using a custom tiddlywiki.info file, just create the directory, enter it, then upload a tiddlywiki.info file.

As always, you can download the latest release from https://github.com/Arlen22/TiddlyServer/releases

Enjoy!
Arlen

All praise to Jesus. 

TonyM

unread,
Mar 17, 2018, 3:00:50 AM3/17/18
to TiddlyWiki
Arlen,

I would rather praise you. Thanks for this new release I have being using it for a while with no problems and just started to use the new features to create a new Wiki from a Template, Create folders and even data folders, or Node instance of TiddlyWiki.

This is very helpful as it allows a simple workflow for creating new Wikis.

The only feedback I have is since new datafolders are defined by the folder name and I can provide the name, these work well. 

Would it be possible to also allow us to rename single file TiddlyWikis using the interface so I do not need to go to file manager to rename empty.html or templatewiki.html ?

Great work and Thanks again.

Regards
Tony

Mark S.

unread,
Mar 31, 2018, 2:30:33 PM3/31/18
to TiddlyWiki
I'm trying this on linux, but getting this error:

SyntaxError: Unexpected token =
    at exports
.runInThisContext (vm.js:53:16)
    at
Module._compile (module.js:374:25)
    at
Object.Module._extensions..js (module.js:417:10)
    at
Module.load (module.js:344:32)
    at
Function.Module._load (module.js:301:12)
    at
Module.require (module.js:354:17)
    at
require (internal/module.js:12:17)
    at
Object.<anonymous> (/home/mint/Downloads/TiddlyServer-2.0.12/src/server.js:6:24)
    at
Module._compile (module.js:410:26)
    at
Object.Module._extensions..js (module.js:417:10)

With this settings file:

{
   
"tree": {
       
"TW2014": "/media/mint/Acer/D/data/TW2014/",
       
"test": "test/",
       
"relative": "../relative_to_settings_file",
       
"linux": "/home/ubuntu/",
       
"branch": {
           
"twig1": "C:/Some Folder",
           
"twig2": "C:/Some Other Folder"
       
}
   
},
   
"types":{
       
"htmlfile": ["htm", "html"]
   
},
   
"username": "MAS",
   
"password": "",
   
"host": "127.0.0.1",
   
"port": 8080,
   
"backupDirectory": "",
   
"etagWindow": 0,
   
"etag": "",
   
"useTW5path" : false
}

What am I doing wrong?

Thanks!
Mark

Arlen Beiler

unread,
Apr 1, 2018, 10:44:10 PM4/1/18
to TiddlyWiki
Make sure you are running Node version 6 minimum. 

--
You received this message because you are subscribed to the Google Groups "TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tiddlywiki+unsubscribe@googlegroups.com.
To post to this group, send email to tiddl...@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/ce8c14c9-9099-4bbf-b753-8c68e4dc94c5%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Mark S.

unread,
Apr 2, 2018, 12:23:13 AM4/2/18
to TiddlyWiki
Thanks!

Next problem. If you make a mistake entering your name password, you will get the "Wrong user or password" message. You will get this even if you stop and start the server. You get it even if you clear out the cookies. You get it even if you go into the settings file and set a new user name. There's apparently no forgiveness built in. What do I do to get it to reset?

Thanks!
-- Mark
To unsubscribe from this group and stop receiving emails from it, send an email to tiddlywiki+...@googlegroups.com.

To post to this group, send email to tiddl...@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywiki.

Arlen Beiler

unread,
Apr 2, 2018, 4:18:58 AM4/2/18
to TiddlyWiki
That sounds like a browser problem. Search "clear basic auth credentials in [your browser]".

To unsubscribe from this group and stop receiving emails from it, send an email to tiddlywiki+unsubscribe@googlegroups.com.

To post to this group, send email to tiddl...@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywiki.

Mark S.

unread,
Apr 2, 2018, 4:00:57 PM4/2/18
to TiddlyWiki
Thanks,

I'm using the latest (49.0.2) Firefox ( Linux).

I had to do a draconian clean-out of all recent logins before it would work. Apparently this is one of those problems that have been allowed to simmer for more than a decade.

I was not able to upload image files. I assume that you browse to the file and then "Submit Query" ?? It failed silently with no error message other than the end of the browser URL  changing to "?error=upload" .

Making a directory and making a directory as a data directory both worked.

Thanks!
Mark

Arlen Beiler

unread,
Apr 3, 2018, 1:23:40 AM4/3/18
to TiddlyWiki
Was there an error message in the console output? There should have been something there. Most of the errors in TiddlyServer are printed to console rather than returned to the client. 

To unsubscribe from this group and stop receiving emails from it, send an email to tiddlywiki+unsubscribe@googlegroups.com.

To post to this group, send email to tiddl...@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywiki.

Mark S.

unread,
Apr 3, 2018, 9:52:50 AM4/3/18
to TiddlyWiki
I was uploading an image. The error console says:

we are insidehttp://127.0.0.1:8080/IMAGE_PATHS/TW-Images/?error=upload
logsimple.js:15:3
The character encoding of the HTML document was not declared. The document will render with garbled text in some browser configurations if the document contains characters from outside the US-ASCII range. The character encoding of the page must be declared in the document or in the transfer protocol.

It seems to think it was uploading an HTML file.

Another question -- In the settings.json, is there a way to set lazy-loading and other command options?

Thanks!
-- Mark

Arlen Beiler

unread,
Apr 3, 2018, 11:19:15 AM4/3/18
to TiddlyWiki
I'm sorry, I meant the terminal output from TiddlyServer. Meaning the output from file descriptor 1 (stdout) from running the command "node server.js". I don't know what you call it in Linux, but in Windows I would just say the output from the command prompt.

To unsubscribe from this group and stop receiving emails from it, send an email to tiddlywiki+unsubscribe@googlegroups.com.

To post to this group, send email to tiddl...@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywiki.

Mark S.

unread,
Apr 3, 2018, 12:20:41 PM4/3/18
to TiddlyWiki
Here it is --

 SER-API  2018-04-03 09:16:32  EXDEV EXDEV: cross-device link not permitted, rename '/tmp/upload_d4764ec4d05eef63b43af05f894554a7' -> '/home/mint/Downloads/TiddlyServer-2.0.12/test/TW-Images/Bowline_on_a_bight.jpg'
                                 
/tmp/upload_d4764ec4d05eef63b43af05f894554a7
[2018-04-03T09:16:32.874-0700] POST    127.0.0.1       302 127.0.0.1 /IMAGE_PATHS/TW-Images/?formtype=upload                     9.164 ms - -
[2018-04-03T09:16:32.894-0700] GET     127.0.0.1       200 127.0.0.1 /IMAGE_PATHS/TW-Images/?error=upload                        0.863 ms - -
[2018-04-03T09:16:33.054-0700] GET     127.0.0.1       304 127.0.0.1 /directory.css                                              0.428 ms - -
[2018-04-03T09:16:33.062-0700] GET     127.0.0.1       304 127.0.0.1 /icons/folder.png                                           0.375 ms - -
twboot
-/home/mint/Downloads/TiddlyServer-2.0.12/test: 430.342ms
[2018-04-03T09:16:47.829-0700] GET     127.0.0.1       200 127.0.0.1 /test/recipes/default/tiddlers.json                         432.996 ms - -
 syncer
-server-filesystem: Dispatching 'save' task: $:/StoryList
 filesystem: Saved file /
home/mint/Downloads/TiddlyServer-2.0.12/test/tiddlers/$__StoryList.tid

Thanks!
-- Mark

Arlen Beiler

unread,
Apr 3, 2018, 12:37:18 PM4/3/18
to TiddlyWiki
Wow, interesting. 

 SER-API  2018-04-03 09:16:32  EXDEV EXDEV: cross-device link not permitted, rename '/tmp/upload_d4764ec4d05eef63b43af05f894554a7' -> '/home/mint/Downloads/TiddlyServer-2.0.12/test/TW-Images/Bowline_on_a_bight.jpg'

Apparently, there is some caveat to Linux that makes this more than a simple move command. I don't understand the inner workings of Linux though. Try creating a test file in /tmp and then moving it to /home/mint. Let me know which commands work and which don't. 

To unsubscribe from this group and stop receiving emails from it, send an email to tiddlywiki+unsubscribe@googlegroups.com.

To post to this group, send email to tiddl...@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywiki.

Mark S.

unread,
Apr 3, 2018, 1:07:53 PM4/3/18
to TiddlyWiki
Since there's a bunch of "upload_" files in the tmp directory, I was able to test:

mv upload_d4764ec4d05eef63b43af05f894554a7 /home/mint/test/mypic.jpg

This worked (and it was the test jpg). Do you know if your server is using the equivalent of "mv" ? Or something lower-level?

Thanks!
-- Mark

jwd

unread,
Apr 7, 2018, 1:32:26 PM4/7/18
to TiddlyWiki

Arlen, I suggest you look at https://stackoverflow.com/a/8579946/1124740 - the second comment: "This will not work if you are crossing partitions or using a virtual filesystem not supporting moving files. You better use this solution with a copy fallback" which links to a less (currently) accepted answer to the same question https://stackoverflow.com/questions/8579055/how-do-i-move-files-in-node-js/29105404#29105404

On Linux /tmp is often 'mounted' in RAM to increase speed. Google suggests MINT users often do this though I can't say if that is the default with MINT or something Mark has done with his installation. That would make your fs.rename (line 160 of tiddlyserver.ts) fail since you can't rename a file from one filesystem to another, you have to actually copy the bits and, on success unlink (remove) the original file as the alternative solution on stackoverflow does.

Thanks for continuing to maintain TiddlyServer.

Mark S.

unread,
Apr 7, 2018, 2:02:14 PM4/7/18
to TiddlyWiki
Every so often I consider switching to Linux. It never works, eventually there are programs and drivers I need, even though Linux mostly gets better.

I was running on a persistent USB stick. Actually, 2 sticks, with one dedicated for persistence. I didn't tweak any Linux Mint settings other than to allow persistence in the grub boot.

On another note, changing the IP to 0.0.0.0 didn't allow universal connect. I had to find and insert my local IP number in order to get other devices to connect. One of the devices eventually had an error in a TiddlyWiki file, suggesting that the set-up might not be robust. Think it was a RSOE with something about XHR.

Thanks!
-- Mark

Arlen Beiler

unread,
Apr 7, 2018, 8:56:30 PM4/7/18
to TiddlyWiki
The XHR error is due to a code bug in TiddlyWiki. It happens when the server discovers the TiddlyServer is newer on disk than the one in the browser. I added an etagWindow setting to settings.json to mitigate this problem. 

I'll check into the file copy fall back. Thank you.

--
You received this message because you are subscribed to the Google Groups "TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tiddlywiki+unsubscribe@googlegroups.com.

To post to this group, send email to tiddl...@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywiki.

Jean-Philippe Rutault

unread,
Nov 26, 2020, 3:39:45 AM11/26/20
to TiddlyWiki
Hi everyone,

doing some digging, i'll come accross this post and I still have the same problem with the last version of tiddlyserver and tiddlywiki 5.1.22

 SER-DIR 2020-11-26 09:29:22 EXDEV EXDEV: cross-device link not permitted, rename '/tmp/upload_add9e6cfbb11b251a9b55aabcd1245f7' -> '/home/gotham/tiddlywiki/static/2.png'
                             /tmp/upload_add9e6cfbb11b251a9b55aabcd1245f7
[2020-11-26T09:29:22.921+-100] POST    10.199.1.81     302 172.31.59.2 /static/?formtype=upload                                    222.485 ms - -
[2020-11-26T09:29:22.989+-100] GET     10.199.1.81     200 172.31.59.2 /static/?error=upload                                       5.617 ms - 6751

All the uploads attempts are stucked in /tmp 

/tmp/upload_170ed61a8a33c28cf471e0e2ac4a57d1  /tmp/upload_2d1e4d42db23f6d8915771c3d290287c  /tmp/upload_772ed0a3a194f1bef4b4be3b224264c5  /tmp/upload_ecf1c0800f34062e51adaf27b578801b
/tmp/upload_1a67407c3594e7185a0efeff00ca3a36  /tmp/upload_4d40d55cbdcdf8ec8badde64e442819f  /tmp/upload_add9e6cfbb11b251a9b55aabcd1245f7
/tmp/upload_1cb9f2c4b30f31f7895cfd70c5e9a5bb  /tmp/upload_66325f02269f2436c2cc6ccf3ce44691  /tmp/upload_aeed7111924de407654a35290611f92d

Thanks in advance for your Help
Le dimanche 8 avril 2018 à 02:56:30 UTC+2, arle...@gmail.com a écrit :
The XHR error is due to a code bug in TiddlyWiki. It happens when the server discovers the TiddlyServer is newer on disk than the one in the browser. I added an etagWindow setting to settings.json to mitigate this problem. 

I'll check into the file copy fall back. Thank you.

On Sun, Apr 8, 2018 at 2:02 AM, 'Mark S.' via TiddlyWiki <tiddl...@googlegroups.com> wrote:
Every so often I consider switching to Linux. It never works, eventually there are programs and drivers I need, even though Linux mostly gets better.

I was running on a persistent USB stick. Actually, 2 sticks, with one dedicated for persistence. I didn't tweak any Linux Mint settings other than to allow persistence in the grub boot.

On another note, changing the IP to 0.0.0.0 didn't allow universal connect. I had to find and insert my local IP number in order to get other devices to connect. One of the devices eventually had an error in a TiddlyWiki file, suggesting that the set-up might not be robust. Think it was a RSOE with something about XHR.

Thanks!
-- Mark

On Saturday, April 7, 2018 at 10:32:26 AM UTC-7, jwd wrote:

Arlen, I suggest you look at https://stackoverflow.com/a/8579946/1124740 - the second comment: "This will not work if you are crossing partitions or using a virtual filesystem not supporting moving files. You better use this solution with a copy fallback" which links to a less (currently) accepted answer to the same question https://stackoverflow.com/questions/8579055/how-do-i-move-files-in-node-js/29105404#29105404

On Linux /tmp is often 'mounted' in RAM to increase speed. Google suggests MINT users often do this though I can't say if that is the default with MINT or something Mark has done with his installation. That would make your fs.rename (line 160 of tiddlyserver.ts) fail since you can't rename a file from one filesystem to another, you have to actually copy the bits and, on success unlink (remove) the original file as the alternative solution on stackoverflow does.

Thanks for continuing to maintain TiddlyServer.

--
You received this message because you are subscribed to the Google Groups "TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tiddlywiki+...@googlegroups.com.

TW Tones

unread,
Nov 26, 2020, 4:27:33 AM11/26/20
to TiddlyWiki
Perhaps you could raise an issue here https://github.com/Arlen22/TiddlyServer/issues

Tones

Jean-Philippe Rutault

unread,
Nov 26, 2020, 4:44:57 AM11/26/20
to TiddlyWiki
Issue raised ;)

Thanks
Reply all
Reply to author
Forward
0 new messages