Widget - Download files

Does uploadcare widget support download of the files? Or do I have to handle this myself?
For example, if the user upload some PDF files, I wanted the user to be able to download those files directly on the widget. Is this possible?

Hi @amanrathie,

Sorry for the delayed response! The widget itself doesn’t provide tools for file downloading, but you can get URL of the uploaded file and display it to the user with the help of JS so they can click it and download the file. Add the inline operation to the URL to make it downloadable.

If you deal with multiple uploads, after getting a group URL, you can use the archive operation to create an archive from a file group.

Thank you very much Alex.

1 Like

Hi,

I wondered, when creating these groups - can I set the filename of the files?

Example: I’ve got 10 files uploaded through Uploadcare, which I want to zip and download -> but not with original names, but rather renamed to this specific zip. Is that possible? If so - how? I can’t seem to find it in the docs.

Hi @matteo,

There’s no way to change the original file name stored in file metadata. You can specify a name on download when it comes to single files.

When you download a group as an archive, you can also specify the output file name for the archive file by adding a name to the URL after the last slash. For example,

https://ucarecdn.com/088de3b6-c5f2-4f56-9e9c-87b0b960286e~3/archive/zip/myarchive.zip

But in the archive, individual files will have their original names.

Thank you! I ended up using JSZip - which works like a charm!

1 Like