PUT uploader and rclone

Will the PUT uploader work with the RClone webdav? For me, I get a constant 404 error saying the put directory doesn’t exist. (it’s “files”, and it does exist). Put maybe I need some special criteria on the rclone command line? Or maybe the path is relative to something I’m not suspecting?

Thanks!

My testing with the PUT uploader and WebDAV setup uses nginx. I did at one point test with rclone on Android and that worked fine.

I recommend checking the requests being sent to make sure that the path being used is actually what you expect it to be. It has been a while since I looked at the code and I do not recall if the path is relative to the server root, or to the tiddlywiki file.

Personally what I have been using is an advanced version of the PUT uploader that also creates directories as needed, supports custom paths and nested directories etc. If I ever get the opportunity to clean that up and update it to use cascades, I will publish it.

Edit: the config UI for the PUT uploader suggest the path is relative to the TiddlyWiki file and not the server root.

1 Like

Ok, so the problem was that forward slashes in the title are interpreted as file structures. Those sub-structures don’t exist, so there’s a 404 error. Could there be an option to convert / into “-” ?

The other problem, or question, is how are the images stored? Jpg? PNG? If the image is internal (pasted from somewhere, or from tiddlyclip) then there might not be an extension on the tiddler name. The exported image doesn’t have an extension.

Thanks!

There is no plan to work more on this PUT uploader, all of this is just code I have written for myself that I decided to share sans support for anyone that found it useful. However the code is pretty straightforward so if anyone wants to contribute improvements I would be happy to merge them.

I do hope to have time in the next couple of months to publish the advanced uploader I mentioned which is WebDAV specific as opposed to a more generic PUT uploader. It supports filters ala the ones for file system paths on node.js to allow transforming the title to a file name and path, and could also be used to control extensions. Currently that is all JS based but it was one of the use cases for the :cascade filter run prefix, so I need to find time to port that to wikitext.

This hits upon probably the single biggest unresolved issue with the FileUploads plugin: there is no default sanitization of tiddler titles to make sure they are correct filenames, and the filename and type depend on the tiddler title. Part of the issue here is that each backend can have different requirements. Something like the filter mechanism I described above might be a good way forward. For example, the file extension could be derived from the type field of the tiddler.