Best Method for File Downloads-Stack, or?


(Jody Joy) #1

On a Stacks page that also has 5-6 compressed package files for the user to download, I’ve used Kuler FileShare but I don’t like the generic icons. Is there something special about this function- file downloading - that requires a stack to perform? Is there another way to accomplish this that will allow me to use whatever graphic I choose to let the user download these files which are hosted in a folder on my server? Obviously Kuler FileShare requires the link to the file location on the server, but if I just try to use a graphic and add the same link this doesn’t work, so I am not understanding what function the stack performs, or how to make this work another way.

Suggestions welcome!
Jody


Force Download of Linked File
(Mark Sealey) #2

FileSafe from NimbleHost works well.


(Mathew Mitchell) #3

Jody: I may be misunderstanding your question, but there are lots of ways to initiate downloads from your website. For instance, I take advantage of Will Woodgate’s themes which work with Bootstrap elements. I zip, then upload a file/folder, copy the URL, and use this generic HTML:

<a href="fullURLhere" class="btn btn-primary">name-of-text-in-button</a>

Joe Workman’s Foundation theme offers a similar capability with his buttons.

Or you can simply use Will’s Linkbox stack:
https://stacks4stacks.com/linkbox/

The stack is free: what a deal!

Given what you’ve written Linkbox is probably your best choice and seems to meet all your needs. But there’s a ton of ways to initiate a file download.


(Jody Joy) #4

Thanks Mathew, I will give Will’s Linkbox stack a try. I don’t code, and the theme is a SeyDesign one, so I don’t want to create problems when I don’t know what I’m doing with Bootstrap. I also am delaying purchasing Foundation for a while. I just wanted to be able to use a custom graphic that when clicked would initiate a download of a zipped file from my server.


(Mathew Mitchell) #5

@Jody: Let us know how Linkbox works for you. It should be a perfect solution, but I’m pretty sure we can help if problems arise.


(Mathew Mitchell) #6

@Jody: Yesterday Will came out with another stack called ImageWizard. It’s a paid stack, whereas Linkbox is free. But one of the nice features (amongst many) of ImageWizard is the nice graphical way to make an image a link. More info here: https://stacks4stacks.com/imagewizard/


(Jody Joy) #7

Perfect Mathew! Thanks for the heads up, I’ll check it out right away.


(Jody Joy) #8

I’ve asked Will whether the link setting available for one of the settings in Image Wizard (yes, I watched Will’s video) would also initiate a download. I am assuming it does not and I believe there is an additional coded function to automatically enable a download. Just providing a link to let’s say, a file on a server does not automatically initiate a download. There will be an error message. I’ve tried this with the usual RW method of using a graphic and setting a link. If that’s all there was to it I’d be all set.

So I’ve encouraged Will to think about adding this ability to Image Wizard, which otherwise appears to be a wonderful addition to his Stacks4Stacks lineup.


(Mathew Mitchell) #9

Quick response (I’m in a meeting). The “trick” to initiating a download is to make sure the file/folder is zipped. Anything with a “zip” extension will be automatically downloaded. All you need to do is provide the link to that zip file/folder.


(Jody Joy) #10

Just had a response from Will Woodgate. Here it is in it’s entirety. Hopefully it will come through:

Hi Jody,

Yes this is perfectly possible in ImageMagic already, if you’re okay to sacrifice support for downloads in Safari. The trick is to give your linked image a custom attribute of download, like in the attached screenshot, when you are setting your image link.

Then when someone clicks the link in Chrome, Firefox, Opera or Internet Explorer Edge, the file you link to will download instead of open in a new browser window or tab. It’s very easy to do and works reliably. But for some reason Safari has not added support for this yet, so the link will still open in the browser window instead of download.

You can read more about the download attribute here:
http://www.w3schools.com/tags/att_a_download.asp

I have attached an example project file to this email too that you can preview and test in Chrome or Firefox. You should find the text file I have linked to downloads.

Regards,
Will.


Force Download of Linked File
(Pip) #11

Imagewizard works perfectly for this downloading of files, and it is great that it is so up-to-date with proper HTML5 standards.

I bought Sweet button, and so was frustrated when I tried to do the same with that, only to find that it hasn’t adopted these HTML5 standards and so although you can enter the correct HTML5 attributes, they don’t work on ANY browser.

Will is right that these attributes work fine in all the latest browsers except for Safari, but as of September 2015 Safari only accounts for 3.6% of browsers so it is only a handful of users who would have a problem, which is miniscule in comparison to the MASSIVE number of people - over 96% - who will have a far more pleasant user experience due to a file downloading correctly and NOT opening in the browser window, which is what happens if you use an older, more dated solution such as Sweet button.


(Robert Ziebol 🖖🏼) #12

To say Sweet Button is outdated is kind of unfair. I have tested 6 buttons

  1. Foundation Button
  2. Standard Stacks Button by Yourhead
  3. Flat Button by Elixir
  4. Button+ by Big White Duck
  5. Pure Button by 1LD
  6. Bootsnap Button by Yabdab

Only one of these buttons uses the Download attribute. You can see my test here
http://www.zeebedesigns.com/button-test/
remember, do not test in Safari, as this browser does not work with this attribute.

The winning button stack is the Standard Stacks button by Yourhead.

Again, calling all of these stacks dated, is really unfair. I understand your frustration with your purchase of sweet button not working, but if you would have used most other solutions out there, they would not have worked either, and they are not dated either. I think it is more of a situation of the attribute either being new or not widely used.


(Joe Workman) #13

It all depends on how the button stack was implemented. The next version of sweet button will take a different approach so that whatever you add in as attributes will work. Hindsight is always 20/20 right. However, Sweet Button does work will all of the most common attributes that you would want to add. I explicitly watch for them being added.

Plus the download attribute is only supported by half of the browsers out there anyways…

If you want to make sure that a file is downloaded with the correct name, just make sure that you name it properly on the server. Does not seem too hard to me.


(Pip) #14

Sorry, if I implied it was outdated. I actually think Sweet button totally lives up to it’s name - i.e. it’s Sweet. I found it makes creating very attractive buttons seriously easy, and love so many of the features.

My only puzzle was with regard to downloading. It just seemed odd that a standard attribute that has been adopted by over 96% of browsers, won’t work. That’s all. Apple have dragged their feet with Safari, and now less than 4% of people use it (according to the latest stats), which means a cool feature - such as the ability to download a pdf by clicking on a button, without it opening in the browser window - is held back from everyone else because of those 3.6% - at least that’s how it seems.


(Mathew Mitchell) #15

@Pip: While I get what you are saying about Safari, it doesn’t seem you face a big practical problem. Why not just zip the PDF first, upload to server. All browsers (even that scraggly 3.6% one) will auto-download a zip file/folder.


(Pip) #16

You’re totally right Mathew, I’d be fine myself with a zip file, but pretty much all modern sites can download a pdf document without forcing the user into having to download a zip and then unzip the zip file to extract the pdf file and then delete the zip file before clicking on the pdf to open it.

I just want to make life easy for my users who are business people and not techies. But no worries, as there are other solutions, I just like everything else about the Sweet button stack - it is very cool - so wanted to use that for all my buttons, including the download ones.


(Mathew Mitchell) #17

@Pip: Totally understand you wanting to make things as easy as possible for the user. About 5 years ago (maybe even 4 or 3 years ago) I’d run into some folks who had problems with one organizational website I helped develop with downloading zip files. But since that time it seems everyone’s OS auto-downloads and auto-unzips. So, for the user, the experience is simple and seamless. I suppose there might still be some businesses where their OS setups still don’t do this: you would know better than me.

However I sometimes use Chrome or Firefox instead of Safari, and when there is a PDF link that I click the PDF shows up embedded in my browser (just as with Safari): so if I want to download I need to hover over bottom of page and choose the download icon. Is this not what other people also experience? (I’m truly asking a question her, perhaps my experience in this regards is not the norm.)


(Pip) #18

@Mathew Mathew. I’ve figured it out thanks to zeebee’s excellent button analysis (cheers zeebee).

It turns out the standard button that comes with Stacks 3 works just perfectly as far as the download attribute is concerned and doesn’t necessitate any zipping.

So, all I’ve done is add the pdf to resources, use the default Stacks 3 button, add the ‘download’ attribute, and hey presto, the pdf file downloads to the users computer as a pdf file, which is what I was wanted. And for the 3.6% of people who use Safari the pdf just opens in the browser, which is no major worry as they’ll be used to that. They can always right-click and download it that way.

Gosh, it isn’t even lunch time and I’ve already made good progress. It is going to be an awesome day :smile:

Thanks for spurring me on Mathew!


(Mathew Mitchell) #19

@Pip: Fantastic! Glad it all worked out nicely for you.


(Jody Joy) #20

Well this is great information coming out now, thank you everybody for contributing. I really have never even used the standard Stacks button so didn’t realize it had a download ability. Wonder if it would work for mp3 files as well as pdfs? I’ll have to check it out, thanks for bringing it to my attention.