Hello,
I use nextcloud to provide customers with various data (mostly PDF).
I would also like to provide the URL to this data as a QR code.
When the QR code is generated, I only know the file name, not the file ID, because the data is uploaded afterwards. Is it possible to create a URL (for the qr code) from the folder and file names?
I understand that the customer has to log in when they scan the code for the first time. But from the second scan onwards, the file (in this case PDF) should open directly.
Thank you very much for the help and best regards
Alex
As @bb77 wrote, you need to know the exact path where you are going to store the files. By default Nextcloud generates a random path, but by using the ShareRenamer app you could get around this situation.
But even then, afaik, you cannot link directly to a file via …/path/to/file, or can you?
Internal links look like this: https://cloud.yourdomain.tld/f/somerandomstring, and cannot even be renamed, afaik. So the only way I can think of to determine the url to a file before it was uploaded is to use public links, rename them, and password protect them if necessary.
Of course that wouldn’t be an issue if @Alex225 could create the QR codes after uploading the files.
@bb77 Due to the fact that @Alex225 spoke about “customers” I assumed that only public links are used instead of local shares. For a short test I shared a folder via public link without using the ShareRenamer app. It looked like this:
https://<server-name>/AAbbCCddEEffGG
To this directory I copied a pdf file, named e.g. my-share-test.pdf
By using the following url format I was able to directly download the file:
Yes, me too, but either way, to my knowledge, the location or path where a file or folder resides on Nextloud does not matter, because links, whether internal or public, always carry a randomly generated token or ID that does not depend on the location or path of the respective file or folder. The only difference in this context is that links to public shares can be renamed using the ShareRenamer app, and internal links, as far as I know, cannot be renamed.
Sorry, but Nextcloud is probably the wrong tool for that. Nextcloud is a file sharing and collaboration suite, like M365 or Google Workspace, not an inventory management tool. I mean, I’m no expert in this area, but the fact that you want to create files for each item just feels wrong. That’s what databases were invented for, and there are specialized tools built around them for always any possible usecase.
No, that would be a manual process. The only way that might be feasible, but probably not even that if we’re talking about 100,000 items, would be if you create files for each item in advance, then create a share link and a QR code afterwards, which would still be a manual process (or at least I wouldn’t know a way to automate this), then stick the QR to the shelf when the product arrives, or whatever you plan to do with it.
Maybe you could also create placeholder files and shares beforehand and then use a tool outside of Nextcloud to automatically create the QR codes for those share links, and just don’t rename the share links afterwards,
I mean, it’s QR codes, there’s no need for friendly names in the links or in the filennames, right? Of course, you would then have to establish a system to know which filename refers to which item, and that’s where inventory management tools shine, expect that they use databases instead of files for referencing to things, just like Nextcloud does for referencing to files…
So while others may chime in here with ideas, I have a strong feeling that you probably shouldn’t try to avoid a proper solution to implement your plan.