Forum Academy Marketplace Showcase Pricing Features

Trouble downloading files!

Hi, guys ! A while ago I decided myself to try and create a cloud storage site. The problem is that I can’t figure out a way to download the files that were uploaded. I have tried putting this in an HTML box:
When I press the download button I just come to the files URL and then maybe I can download manually, but I need it to be automatically. Otherwise the cloud service won’t be compatible with all files.

I would really appreciate your help!
Andreas

Hey Andreas :slight_smile: Did you try using a link element? If you set the link to be an External URL, open in a new tab, and then have the URL be the file URL, I believe those settings should download the document automatically, on-click. (However, if it’s an image - I think it will open in a new tab on-click first).

Thanks for your reply but I’m not sure I follow, could you perhaps explain in another way?

Sure! Here is a screenshot:

In this example, my Type of Thing is Resume, and Resume has a field to store the File (type: file, list: no). The link element inside states “Click to Download” as the text, and the URL is the URL where the Resume File is stored.

In preview mode, when a User clicks on the link - it should download automatically as long as the file was uploaded using the file uploader and not the photo uploader. Let me know if that works for you and if not I can definitely try to assist in setting this up. :slight_smile:

Thank you very much for your help, Unfortunately your method didn’t work with some of the most common file types like .txt .pdf .png .jpeg.

I found this option on Stack Overflow and tested with jpeg and txt; I think it works! :slight_smile: With an HTML element use the code:

Thank you very much, Faye, you almost solved my issue! There is one problem and that is that when I tried to download one of the pdf files it downloaded result.xls instead! Strange huh?

My pleasure Andreas! :slight_smile: I just tested with a pdf as well and it did download correctly for me. However, when the file field is empty, it will download ‘result.xls’ instead. Maybe double-check to see if the file field that should contain the pdf isn’t empty?

Yes it contains a file, and this only happens to one pdf file over and over again.

Does this one work for you? (removing the results.xls)

I also noticed in the first example that I just put “Parent group’s Resume’s File”. Even though this worked, I should have put “Parent group Resume’s File’s URL”.

2 Likes

Now i think it really works, but im still going to test with some more files. So thanks again ! :raised_hands: :tada:
And this time i hope it works 100% :joy:

2 Likes

My pleasure! Yes! Definitely let me know if it works for all of the files! :slight_smile:

From memory, the “download” attribute on an anchor link doesn’t work on Internet Explorer.

IE has other solutions depending on the version of IE. It can get a little messy!

1 Like

Thanks for the heads up Misha! :slight_smile: A bit messy indeed.

This thread talks about using “MsSaveBlob” for IE? To do this would it need to be a javascript plugin first?

Javascript yes, not necessarily in a plugin though.

Who’s going to follow the white rabbit? Haha!

1 Like

Ohh I see! I will try it out.

:joy: I almost lowercased that M, but… I really liked Ms. Save Blob better!

This topic was automatically closed after 70 days. New replies are no longer allowed.