/    Sign up×
Community /Pin to ProfileBookmark

How can I make it possible for visistors to download files from my page?

I have some files (doc, pdf, exe) that I want the visitors of my web page to be able to download. How can I accomplish that?

I have a folder for all webpages called “MyDomainWeb” and one folder called “downloads”. These two folders are on the same hierarchical level.

In the download folder I have three files. File1.doc, File2.pdf, File3.exe.

What code would make it possible for the user to download the file that is clicked?

One of my web pages look like this:

[CODE]<!DOCTYPE HTML PUBLIC “-//W3C//DTD HTML 4.01 Transitional//EN”>
<html>
<head>
<meta http-equiv=”Content-Type” content=”text/html; charset=iso-8859-1″>
</head>

<body>

Click on the file that you want to download<br>

<p>File1.doc</p>
<p>File2.pdf</p>
<p>File3.exe</p>
<p>&nbsp; </p>
</body>
</html>[/CODE]

Any ideas on how to solve this little problem?

to post a comment
HTML

6 Comments(s)

Copy linkTweet thisAlerts:
@bluflamez09Aug 28.2005 — You have two options:

You can put them in ZIP folders, and link to that OR you can put instructions on your web page to "left click and save as...".

If you do the "left click save as..." option, you will not need to put them in ZIP folders.

Does this help or do you need more detailed information?
Copy linkTweet thisAlerts:
@PelleauthorAug 28.2005 — I would like some more detailed info because I don't understand either of the alternatives you mentioned.

What I want to happen when the user clicks the file is that a prompt should pop up and ask where on the computer the file should be saved. The user should of course also have the option to cancel the download at this stage...

I have never made any files publicly available for download in this way so I appreciate a detailed explanation.
Copy linkTweet thisAlerts:
@zyghAug 28.2005 — you can create links for the right click save as option....

something like this....
-----------------------------------------


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html>

<head>

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

</head>

<body>

Click on the file that you want to download<br>

<p><a href=http://yoursite.com/file1.doc">File1.doc</a></p>

<p><a href=http://yoursite.com/file2.pdf">File2.pdf</a></p>

<p><a href=http://yoursite.com/file3.exe">File3.exe</a></p>

<p>&nbsp; </p>

</body>

</html>
------------------------------------------------


This should make it so all they have to do is click on the links then they should get a option on where to save it as then they can start downloading it....


zygh
Copy linkTweet thisAlerts:
@james_d_kellyAug 29.2005 — Sounds to me that the method that will best fit your needs is to zip each file you want avaliable for download by using Winzip on your computer and upload these .zip files to the "downloads" folder on your sever.

(Note: im assuming your using the same file names for the .zip files as the zipped files)

Simply add hyperlinks to the .zip file like this:

[B]<a href="downloads/file1.zip">File1.doc</a>

<p><a href="downloads/file2.zip">File2.pdf</a></p>

<p><a href="downloads/file3.zip">File3.exe </a></p>[/B]
Copy linkTweet thisAlerts:
@PelleauthorAug 30.2005 — I have figured it out now ?

Thank you for your help, everyone.
Copy linkTweet thisAlerts:
@Jennifer4evaAug 30.2005 — one recomandation for you.. if you have &#8220;MyDomainWeb&#8221; and "downloads" on the same hierarchical level, then you should use

<a href="../downloads/file1.doc">File1.doc</a>

<a href="../downloads/file2.pdf">File2.pdf</a>

<a href="../downloads/file3.exe">File3.exe</a>

rather than

<a href="www.yoursite.com/downloads/file1.doc">File1.doc</a>

<a href="www.yoursite.com/downloads/file2.pdf">File2.pdf</a>

<a href="www.yoursite.com/downloads/file3.exe">File3.exe</a>

it's just easier to maintain, and in case you move your site to another location or you rename the &#8220;MyDomainWeb&#8221; folder, you will not need to update all your hyperlinks
×

Success!

Help @Pelle spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.5,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,

tipper: @Samric24,
tipped: article
amount: 1000 SATS,
)...