Download file..aaaahrg!

Hi All,

Perhaps one of the most stupid questions on the forum but I ran into the following issue:
In the backend my app generates a .docx which is stored as a private file. IN the filemanager indeed i see the thing the file is connected to. So far so good.

In the browser i have a button “Download file” - connected to the download file workflow, however it keeps throwing an error at me no matter what i try:

”There was a problem generating your file. Please verify your file type and try again.”

When i set the file storage to “public” there is no issue and the function works.
I’m 100% positive that the privacy conditions are fulfilled when i’m trying to download the file. When i for exampel use the debugger and copy the link to the file into a new browser tab it just downloads right away. (When i copy it in a private tab it doesnt).

What i tried:

  • Remove the fix on the file name

  • Tried various things for the dynamic link to the source file:
    just pointing at the file;
    pointing at the file’s URL;
    pointing at Saved to Bubble storage.

It does not seem to matter i just don’t get the file, only the error? Does anyone know what i’m doing wrong?

Thanks!

Looks like an issue with your privacy

Have you tried setting the same conditions on a text element and setting it to visible only if the conditions are satisfied? I’m not sure what the answer to this problem here is, but debugging like this helps me at times

The error happens because the “Download file” action can’t generate a signed URL from a raw file URL. When using private files, make sure you’re pointing to the file object (e.g., Thing's File) rather than Thing's File's URL. Bubble will then create a valid signed link if your privacy rules allow it. If you need a quick workaround, you can also use a regular link element pointing to the file instead of the “Download file” action.

Thanks unfortunately that doesn’t work. Indeed now trying the open in new tab (external page) option which downloads the file. Only issue is when user is working in incog. browser mode but fix that with airalert.