Display a link to download specific data from a collection

I have a data field in my collection that is a license key we generated.

I want the customer to be able to download this license key by clicking on a link to download a (for example) *.license file that contains the license key from the data field in our collection.

I’m going to end up showing this in a listRepeater, so each item in the listRepeater will have a link to download the data from the licenseKey field.

An item in the listRepeater should look something like this mock-up:

Suggestions? The data in the licenseKey field in the Collection will be 256 characters (or something like that, but not up to me) and we’ll just want to download it to “order-10026.license” with the 256 characters as-is.

Summarize: embed a Download link in a listRepeater to download a data field from a Collection to a file called something.license on the user’s machine.

I guess there are two issues here. 1. how do I generate the link to the data, and 2. how do I embed each unique link in each listRepeater item during page generation?

Was hoping to hear from some folks on this one. I have some ideas to try out and will always post solutions back here for all to benefit from. We can’t be the only Wix customers who want to store and allow to be downloaded a license file. We expect to generate a lot of licenses, so keeping them as small text files would just be painful in my opinion.

Bumping this to hopefully hear from a helpful expert. Thanks!

Bumping again. Would be nice to get some help from the forum on this.

As i can see you already have seen this post here?

This is not a possible solution for you ?

I guess there are two issues here. 1. how do I generate the link to the data, and 2. how do I embed each unique link in each listRepeater item during page generation?

How i see your situation.

  1. You have a database where you store your licence-keys (Datafield —> “keys”)
  2. You use a repeater which will generate a list of all the entered keys (of course hidden).
  3. also you will have a button in the repeater which calls related data of each entered DB-value.
  4. At least you have an HTML-component which will find the right key-value in your DB by click on the corresponding button.
  5. Export the found key trough for example a CSV-File or XLS-file or whatever.

Surely the same can be done by using an export as TCT-file.

To find more information on this, try to search for such a function in “Stack-Overflow” or “GitHu” and perhaps also in “W3School”.

This would be my idea how to solve your problem.

BUT ATTENTION! → Since you work with sensitive data, you should of course work on the BACK-END and perhaps also use the wix-secret-manager for your purposes.

Good luck and happy coding.

EDIT:
This post could also be very helpfull for you and give you new ideas how to solve your problem.
https://www.wix.com/velo/forum/coding-with-velo/trying-to-download-using-html-element

@russian-dima Thank you very much for your response. I had jury duty today, so I didn’t get much done. I will digest this post tomorrow and respond properly. Thanks again @russian-dima

@russian-dima I haven’t forgotten about your proposed solution above, but I had to fix my filtering and sort issues first and this link issue/question dropped lower in importance. I will be getting to this soon. Didn’t want you to think you’d wasted your time responding to my query. Thank you again.