Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature] Upload to paperless-ng #351

Closed
Celedhrim opened this issue Sep 1, 2021 · 6 comments
Closed

[Feature] Upload to paperless-ng #351

Celedhrim opened this issue Sep 1, 2021 · 6 comments

Comments

@Celedhrim
Copy link

First , thx for this excellent software !

I use it mainly to scan document to feed my paperless-ng instance.

For this , I first scan , then download the file and upload it to paperless.
Maybe , if possible of course , a good addition could be a button to upload to a paperless instance.

Paperless has an api (https://paperless-ng.readthedocs.io/en/latest/api.html)

I think about 2 field in settings :

  • paperless instance url
  • token

Then a button next to download in files section to directly send file to paperless instance.

@sbs20
Copy link
Owner

sbs20 commented Sep 2, 2021

Hi. Thanks for the suggestion. I like the idea and am keen to work out a solution.

The challenge is to allow for a generic upload. Once a paperless-ng integration goes in, then what about Dropbox / Google Drive etc. I was reading about how to post a document and the docs are a bit thin. When I did some digging it seems that there are plenty of other ways to get documents in - including a simple file copy to the the paperless-ng document location. Let's assume we can solve that problem.

The next problem is the integration itself. One option is to change the UI. This could work but will end up being significant (at least for spare time) development in a clean way which doesn't impact users who don't want to integrate. Another option is to allow people to create their own plugins. This is better but still some work. Another solution would be to add CLI commands to pipelines (configurable items which run when you scan) - but the problem would be having to add commands to every pipeline.

But then it occurred to me, it would be better to write a shell script (or something) which simply scans the scans directory /var/www/scanservjs/data/output/ and transfers the files to the desired destination - using scp, cp, or curl and a REST API, or whatever copy mechanism you want. Put it on a cron job or inotify and it would happen automatically.

Would that work for you?

@Celedhrim
Copy link
Author

Celedhrim commented Sep 2, 2021

Hi.

Yeah I'm ok that it's a bit out of scope for scanservjs , that's why I opened this issue.
I think I will end up with inotify + file name prefix.

  • I scan normally
  • If I want to upload to paperless , juste rename the file with pl_ prefix like pl_document_name.ext then the script will submit document to paperless and remove it from scanservjs file directory.

I think it's a good way to have less manual action ( wife friendly method ! :D ) with the choice to submit to paperless or not.
And your software keep the philosophy : "each program do one thing well" :)

@sbs20
Copy link
Owner

sbs20 commented Sep 2, 2021

Ok cool - I'd be very interested in whatever you come up with though. If you're happy to share something, then put it in this issue and I'll add it to the docs. Also - thanks for your kind words 😄

@sbs20 sbs20 closed this as completed Sep 2, 2021
@Celedhrim
Copy link
Author

Celedhrim commented Sep 6, 2021

@sbs20 , here is what I've done : https://github.com/Celedhrim/scantopl
It's not quality software but it works for me ! :)

I first looked at incron , but it seems deprecated.
So i decided to start a all in one program.

Why I choose golang ? the single simple binary and the easy it's to make it go in docker.
And it's a good reason to try to golang

@sbs20
Copy link
Owner

sbs20 commented Sep 7, 2021

Thanks for this - and nice work!

I have updated the documentation and linked to your code.

@Celedhrim
Copy link
Author

Thx ! :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants