How to set up download from my website?

  • Thread starter aheight
  • Start date
  • Tags
    Set
  • #1
aheight
321
109
Hi,
I have a website and I would like to give viewers an option for downloading a (Mathematica) file. Actually I have a blog in blogger.com which has a menu item to access an index.html file on another hosted website. I would like to store the file on the hosted website and have a button or menu item on my blog to download the file. Basically just want to give an option for viewers to run some mathematica code to help illustrate the topic in the blog. Just not sure how to accomplish this feat and I was wondering if someone could help me with this?

Thanks guys.
 
Computer science news on Phys.org
  • #2
Instructions vary depending on who is hosting your site. You should ask them.
 
  • Like
Likes QuantumQuest and aheight
  • #3
Vanadium 50 said:
Instructions vary depending on who is hosting your site. You should ask them.

Ok thanks. I did that. But in the mean time, I thought I'd try to just set it up via 'Dropbox'. I just saved the file to my dropbox, created a link, then added a menu item in my blog to access the link and it does download to my pc. Have to have Mathematica of course to run it.
 
  • #4
As V50 says, it depends on the blogging platform and on the site hosting the file. I know on Google you can add buttons to your code to get a URL reference (your URL to your file). The browser then not knowing what your file is will then ask the user if they want to download it. Alternatively the browser could have the smarts or be configured to launch mathematica in order to open and run the file.

Here's an example from the MAthematica site about their notebook technology which is probably the way to go:

https://www.wolfram.com/technologies/nb/
 
  • Like
Likes QuantumQuest and aheight
  • #5
jedishrfu said:
Here's an example from the MAthematica site about their notebook technology which is probably the way to go:

https://www.wolfram.com/technologies/nb/

Thanks, good idea. It talks about setting up a CDF file so that anyone can run the notebook without having Mathematica by using the free CDF player. That would provide greater access to my notebook.
 
Last edited by a moderator:
  • #6
The index.html file is not sufficient to set up a file download, you need access to the apache .conf files. In there, you will create an "Alias" to the url that you want to set your download to be, then point that to a specific location on your server (or network.)

For example, I have a benchmark server that both provides an interface through an index.php, as well as downloads of old results in a different location. My conf file has these lines in it.

Code:
Alias /Benchmarks "/var/www/utilities/Benchmarks"
Alias /Downloads "/mnt/datastore/Downloads"
 
  • #7
aheight said:
I would like to store the file on the hosted website and have a button or menu item on my blog to download the file.
How did you put the index.html file on the hosted website? For my website, I create/edit all files (.html, .php, whatever) on my home computer, then upload them using either the file manager in my web host's cPanel, or the 'scp' command at the command line in a MacOS Terminal window on my computer.

If I want to provide a PowerPoint presentation, for example, I simply upload the .ppt file to an appropriate location on my web host, and put a link to it on one of my pages. My browser doesn't recognize .ppt files as something it can display directly, so when I click on the link, the browser asks me where I want to download it to.
 
  • Like
Likes aheight
  • #8
jtbell said:
How did you put the index.html file on the hosted website? For my website, I create/edit all files (.html, .php, whatever) on my home computer, then upload them using either the file manager in my web host's cPanel, or the 'scp' command at the command line in a MacOS Terminal window on my computer.

If I want to provide a PowerPoint presentation, for example, I simply upload the .ppt file to an appropriate location on my web host, and put a link to it on one of my pages. My browser doesn't recognize .ppt files as something it can display directly, so when I click on the link, the browser asks me where I want to download it to.

Ok thanks, didn't realize it was as simple as that.
 
  • #9
Here is an instruction for that

 
  • Like
Likes aheight
Back
Top