Jump to content

How to make a document available for download


Guest Keytone
 Share

Recommended Posts

Guest Keytone

Hi everybody, this probably sounds like a dumb question. I have a document that I want folks to be able to download and I can't think of how to do it. Can you help me? Thanks for any advice, John :facepalm:

Link to comment
Share on other sites

You need PHP or .htaccess for that. You would set the Content-disposition header to "attachment" and the content-type to "application/octet-stream"

Link to comment
Share on other sites

Hi everybody, this probably sounds like a dumb question. I have a document that I want folks to be able to download and I can't think of how to do it. Can you help me? Thanks for any advice, John :facepalm:
Hi Keytone,There is NO dumb question as such. A Question is a Question. That's all. It Iss What It Iss... If you don't know means you just don't know. That's all. So, where would you like to put your document to be able to download?
Link to comment
Share on other sites

  • 2 weeks later...
Guest Keytone

Thanks everybody, I haven't learned enough about PHP yet to be able to use it, I've just been through the W3Schools tutorial and haven't spent any time with it yet.What I wanted to do is put a document such as my resume or a word doc on a page so people could download it from the page. I reckon I'll just have to put my "learning cap" on! :Bucktooth::Pleased:

Link to comment
Share on other sites

Guest LH91325

I'm trying to understand exactly what your question is. The answer sounds too easy. I presume you have an "up place" you can upload your resume or word document to that is accessible from the Internet. Perhaps you have some webspace included in your ISP account, or you could use a shared hosting service. Whatever place you put it, just enter the URL in your browser, like this: http://example.com/my_resume.doc Enter that in your browser and you'll get a dialog like this:

You have chosen to open my_resume.doc wihch is a: Microsoft Word Document.[_] open with Microsoft Office Word[_] Save File
All you need is to make a little HTML page and add a link to that .
<p>Here is my resume: <a href="example.com/my_resume.doc">my_resume.doc</a></p>

Somebody can click that link and they will either view your document live or download it to a local copy, depending on which option they select. Perhaps my reply is a simplistic answer but I note that you've posted this in the HTML forum section, not the PHP forum section. You don't need anything other than a place to host your files and the ability to FTP them up there. This doesn't have to be any more complicated than you want to be.

Link to comment
Share on other sites

the issue you are most likely to encounter is browsers trying to open the files themselves. Ingolme was alluding to this in his post. You are going to need to do something like this to get the effect:http://stackoverflow.com/questions/3476362/how-to-force-a-file-to-download-in-php

Link to comment
Share on other sites

Guest LH91325

Yeah, that sounds like a good idea: use a script. My suggestion (just putting it in a directory) depends on how site visitors set their browsers and which browser (and version) they're using. Some people set their browsers to automatically open .DOC files (not a good idea in my opinion), but to do the job right requires a browser independent way of addressing it. You could do that by an appropriate .htaccess directive but that may either not be available or might be over the OP's present knowledge level, as also may be the scripting unless the script can just be downloaded and copied to a website. I wonder if a ftp:// link would work?

Link to comment
Share on other sites

FTP, though, requires giving the site visitor FTP access. My original suggestion, though, was assuming he meant HTML document, as he hadn't specified what kind of document he meant.

Link to comment
Share on other sites

Guest LH91325

There's such a thing as anonymous FTP access, but probably requires more authorization than most people have on their shared servers. Certainly more authorization than needed to put in place .htaccess and force the file to download. I guess that .htaccess line would be this:

AddType application/octet-stream .doc

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...