Hi Mark,
This is a question and a half as not many people would do it from a command line.
Not sure if this would be of any help but I'm almost sure you can't produce shares from the occ command so API is the only way:
https://docs.nextcloud.com/server/latest/developer_manual/client_apis/OCS/oc...
Wouldn't it be easier to just share the file manually from either the website or NC client :) ?
Cheers Bart
10 Aug 2023 12:20:54 Mark Rogers mark@more-solutions.co.uk:
Any nextcloud users here who are familiar with the API?
All i want to do is have a script which uploads a file to my nextcloud server, creates a read-only share link for it, and outputs that link.
So when I have a file that's too big or otherwise unsuitable for email, I can simply push it to nextcloud and paste the supplied link into my email instead. This seems like a fairly obvious use case but my attempts at Googling a solution have thus far failed me.
Uploading a file from a script is easy and there are plenty of examples out there but creating a share link from that point has me (and ChatGPT, and Google Bard) stumped.
Mark
Mark Rogers // More Solutions Ltd (Peterborough Office) // 0344 251 1450 Registered in England (0456 0902) 21 Drakes Mews, Milton Keynes, MK8 0ER _______________________________________________ To unsubscribe send an email to main-leave@lists.alug.org.uk http://www.alug.org.uk/ Unsubscribe? See message headers or the web site above!