Automatically upload, share, generate link with expiration date


#1

Hello, everybody,

I finally installed Nextcloud and I am very satisfied. Now I have a special concern and would like to know whether the problem can be solved at all and if so, how best to tackle it

I create files (.pdf,.docx etc.) with another program. These files should be automatically uploaded to the cloud. The files should also be shared automatically with a link. And the link needs an expiration date.

So far, this scenario has proved to be a good example:
I receive invoices every month (rent, electricity, car etc.)
My program creates a total invoice from these invoices (TotalInvoiceJanuary.PDF)

  • TotalInvoiceJanuary.PDF should now be uploaded automatically (WebDAV/Windows Network drive?)

  • The file should now be shared automatically with a link. The link should have an expiration date(14 days)

(In the best case the link should be catched again to insert it into a mail)

  • One month later, of course, the whole thing will start all over again with TotalInvoiceFebruary.PDF

I dont want to solve the problem manually. I value that it happens automatically.
I can’t just share a folder because the expiration date on the files won’t work.

I suspect I have to write a small program with direct access via the Share API. My knowledge is limited to the absolute minimum. Do you have any concrete details for my problem or at least good instructions?

Thank you very much for your time and your answers
Kathaki


#2

#push

Anyone an idea?


#3

You should have a look at https://github.com/rullzer/dropit. https://github.com/rullzer/dropit/issues/3 could help you to automate the upload process.


#4

Thank you

I also found this https://docs.nextcloud.com/server/9/developer_manual/core/ocs-share-api.html

How can I use the API? Can I write a windows tool with curl or is it just for android?


#5

It´s a general http api so you can write a simple client in just about any language you want. On Windows you can use PowerShell to write some simple scripts.


#6

Sounds great. Thank you splitt3r

I am unfortunately not a programmer and would be very happy to see an example. Is there a script/tool with open source code that I can view and learn from?


#7

Google gave me https://www.example-code.com/powershell/http_multipart_form_data_upload.asp. Looks like a good point to start.