How can I add a Download link, so that when you click the link, it brings up a 'save as' box?

  • 1
  • Question
  • Updated 8 years ago
  • Answered
I have been trying to add a download link that doesn't just let you see the file, but actually lets you download the file on to your own computer, but so far I have had no luck. Is this possible, or am I just wasting my time?
Photo of fudgyhoops (deactivated)

fudgyhoops (deactivated)

  • 9 Posts
  • 1 Reply Like
  • frustrated

Posted 8 years ago

  • 1
Photo of Callum

Callum

  • 357 Posts
  • 32 Reply Likes
Hi fudgyhoops,
Sometimes if the file is an image or document (pdf, doc, xls etc.) then the browser will open it, if it's an executable or archive then you'll be presented with a 'Save As' box. One way you can force the dialogue box to appear is to instruct the visitor to right-click on the link and click Save As, that way the box will open.

Hope this helps
Callum Booth
Photo of Nazlie

Nazlie

  • 1721 Posts
  • 51 Reply Likes
Oh Callum, we answered at the same time! :)
Photo of Callum

Callum

  • 357 Posts
  • 32 Reply Likes
Woops :P
Photo of Nazlie

Nazlie

  • 1721 Posts
  • 51 Reply Likes
Hi fudgyhoops

If you would like people to download files from your website, use the File Widget! The File Widget makes it easy for you to create a link to a file, so that people can view it on your site or download it.

Here is how to upload a file so that people can view or download it from your site:
  • Drag and drop a File Widget onto your page from the Sidebar on the right. You'll find it under 'Basics' in the Widgets tab - the icon for this looks like a computer disk.

  • When you drop it on your page, a dialog box will open on your screen. You then have the option to browse your computer for the file you want to upload, or select a file you have already uploaded to the File Manager.

  • When you click "OK" a link to your file will automatically be created.

  • To test that it is working, save and preview your page.


Then visitors to your site will be able to click on your link and download your MS Word file, PDF, PowerPoint presentation, spreadsheet or whatever file you have uploaded.

Hint: To download the file, right click on the link, and then select "save as" from the pop-up menu (Mac users: ctrl+click).

I hope this solves your problem. If you need more help with it, please let us know.

Thanks!
Nazlie
Photo of fudgyhoops (deactivated)

fudgyhoops (deactivated)

  • 9 Posts
  • 1 Reply Like
Callum,
Thanks, I don't know why I didn't think about that earlier!
Photo of Nathan

Nathan, Champion

  • 3739 Posts
  • 307 Reply Likes
Hi everyone, if you want it to always bring up the save as box, use this code in an HTML widget:

<!--

<a title="Software Download" onclick="location.href='http://www.YOURSITE.yolasite.com/reso... File by Clicking here</a>

-->

Warning: Don't copy <!-- or --> Just the code in between them

This might work. It worked for my site: (Click the green "Free Download" button) http://www.nathansmusicstudio.tk/tool...
Photo of calebithornton

calebithornton

  • 1 Post
  • 0 Reply Likes
how do u make it so people can log in without getting full account?!
Photo of Marije

Marije, Official Rep

  • 4636 Posts
  • 237 Reply Likes
Hello calebithornton - I'm not sure I understand your question. Do you want to be able to log into a Yola account without creating a Yola account? Or do you want people to be able to edit your website in some way? Feel free to create a new post on the forum asking this question as it's not really related to this thread.
Photo of fudgyhoops (deactivated)

fudgyhoops (deactivated)

  • 9 Posts
  • 1 Reply Like
Nathan,
I tried what you did, but it was just text saying ''Download File By Clicking Here''. What am I doing wrong? I put in my website name where it says YOURSITE in the html, and the name of my file (with spaces) where it says FILE-DOWNLOAD on the html.
Photo of Nathan

Nathan, Champion

  • 3739 Posts
  • 307 Reply Likes
Hi, "Download File By Clicking Here" is the link. If you click it, it will bring up the file download (or it should) Also, make sure where it said "http://www.YOURSITE.yolasite.com" to replace that with your website's URL. And "FILE-DOWNLOAD.exe" make sure to replace that with the file's name (including the extension) What are you wanting the user to download anyways? What's th code you have right now entered in the HTML widget? When you post your code, remember to wrap the code in <!-- and --> Like this:

<!--

YOUR CODE HERE

-->

If you don't we wont see the code because it will render onto the page.

Nathan
Photo of fudgyhoops (deactivated)

fudgyhoops (deactivated)

  • 9 Posts
  • 1 Reply Like
Nathan,
I'm trying to make a .txt document availible. So do I put in ''file_thing.txt'' where the _ is the space in the FILE-DOWNLOAD.exe? Or do I ignore all spaces?
Photo of Nathan

Nathan, Champion

  • 3739 Posts
  • 307 Reply Likes
Hi, you have to use the spaces. Lets say your file has a space in it. Then that part of the code would be like this:

file thing.txt

You always have to have a space if that's how it is in your file manager. If there is a dash like this in your file manager:

file_thing.txt

Then you would have it like that. But, don't put .exe at the end, that whole part:

FILE-DOWNLOAD.EXE

was an example and don't use that because it wont work. .exe is a file format for toolbars and programs and lots of other files.
Photo of fudgyhoops (deactivated)

fudgyhoops (deactivated)

  • 9 Posts
  • 1 Reply Like
Nathan,
I tried what you told me to do once more, with the code looking like this:
<!--

<a title="Software Download"
onclick="location.href='http://www.ibshockscripts.yolasite.co... Buddy ShockwaveScripts By David R-L.txt'">Download File by Clicking here</a>


-->

But all it does is bring up a window saying what's on it. I was looking for something that when you clicked on it, it brought up a 'save as' window, like you did on your website, where it says Free Download in a big green box. I assume it's something to do with the code?
Photo of Nathan

Nathan, Champion

  • 3739 Posts
  • 307 Reply Likes
Hi, I don't know why it's doing this. Try this code:

<!--

<a href="#" title="Download file" onclick='location.href="http://www.ibshockscripts.yolasite.co...; return false;'>Click here to download</a>

-->

For this to work, please go into your file manager and rename that file to this:

Interactive-Buddy-ShockwaveScripts-By-David-R-L.txt

The spaces may be a problem.
Photo of Nathan

Nathan, Champion

  • 3739 Posts
  • 307 Reply Likes
Hi, I'll be back in about an hour and a half.
Photo of fudgyhoops (deactivated)

fudgyhoops (deactivated)

  • 9 Posts
  • 1 Reply Like
Nathan,
Once again, It just opens the contents of the text file. I know your'e gone, and by the time you reply I'll probably be gone too, but when you read this can you tell me what's wrong? The code I used this time was the one you gave to me:
<!--

​<a href="#" title="Download file"
onclick='location.href="http://www.ibshockscripts.yolasite.co...; return false;'>Click here to download</a> <a href="#" title="Download file"


-->
Photo of Nathan

Nathan, Champion

  • 3739 Posts
  • 307 Reply Likes
Hi, I'm sorry. I will try to find a code for you and get back with you when I'm done.

Nathan
Photo of Sanja

Sanja, Official Rep

  • 10698 Posts
  • 495 Reply Likes
Nathan - thank you for all your hard work on this.

I'm wondering if it's a browser-specific behavior? Fudgyhoops - can you let us know what browser and version you are using?
Photo of fudgyhoops (deactivated)

fudgyhoops (deactivated)

  • 9 Posts
  • 1 Reply Like
Sanja,
I'm using the latest version of Google chrome, and, now that I think about it, there has been a lot of problems with my yolasite when I'm on Google chrome... do you think I should switch to Firefox?
Photo of Nathan

Nathan, Champion

  • 3739 Posts
  • 307 Reply Likes
Hi, I have the latest version of Google chrome too. I use Google chrome all the time for Yola and i haven't found any problems yet.
Photo of fudgyhoops (deactivated)

fudgyhoops (deactivated)

  • 9 Posts
  • 1 Reply Like
Then Google Chrome isn't the problem....what about computer type? Would that have any effect on html codes? I've used html before, though, for banners and stuff, but could it be the fact that; a) My laptop is small and not exactly the fastest thing in the world, or b) That I'm operating a Windows xp?
Photo of Nathan

Nathan, Champion

  • 3739 Posts
  • 307 Reply Likes
Hi, I am experienced with HTML and CSS. OS and Computer types usually (and most likely wont) effect an HTML code. I think the problem is that the code I'm giving you isn't the right one. I got the code straight from the free download button, but, I think that the toolbar download is opening the save as box because Conduit.com set it up like that. I will try to get the code to work for you though. Don't worry! I'll think about a code and experiment with some codes. I hope we can get that code for you though!

One more thing: Did you try the "File" widget like Nazlie suggested above? You'll have to have the users right click on the widget to download the fie though.
Photo of fudgyhoops (deactivated)

fudgyhoops (deactivated)

  • 9 Posts
  • 1 Reply Like
Nathan,
Thanks for trying to help me, I really appreciate it. I have tried the File widget that was suggested, and it works, but (I might sound like a real prick saying this) I like stuff to be fancy. But I will go with it if you can't get a html code for me. Thanks!
Photo of Nathan

Nathan, Champion

  • 3739 Posts
  • 307 Reply Likes
I like stuff fancy too. It makes your website look nicer. I will try to find you a code for that.