Uploading from browser or email client🔗
An alternative approach came to mind to directly upload from a browser or email client that at least works on a Linux system. In case this is interesting for others, I'd like to share it here.
Create and activate a source in your collective (in this example MYCOLL); note that path to the file upload (the one with
Create a file
docspell-upload-MYCOLLwith the following content (replace
UPLOAD_PATHwith the actual path):
#!/bin/bash logger -t docspell_upload -- Docspell upload to MYCOLL: "$*" $( curl -s -XPOST -F file=@"$1" UPLOAD_PATH )
Make it executable:
chmod 755 docspell-upload-MYCOLL
Create a file named
docspell-MYCOLL.desktopwith the following content (note that you need the full path to
[Desktop Entry] Exec=PATH_TO_docspell-upload-MYCOLL %F MimeType=application/pdf;application/x-zip;application/x-zip-compressed;application/zip Name=Docspell Upload (MYCOLL) NoDisplay=true Type=Application
Place the file
Configure your browser or mail-reader actions for pdf and zip: They should always ask what to do rather than opening a link or attachment with the standard application or save it to disk by default. Actually, always opening a pdf in the browser is fine, if this allows to later save the viewed file.
Now, when clicking on a file link or attachment, the browser or email client should ask what to do. You then should be able to choose "Docspell Upload (MYCOLL)" from the list, which will upload the file to your collection.
If anything goes wrong, you can monitor the server response with the
journalctl -f -t docspell_upload