Let others download from your Web page

Q Your Help Screen has been very helpful to me so far. Many thanks. I wonder if you have the solutions to my questions this time?

1. I know how to create pop-up windows using JavaScript, but I don't know how to make them disappear automatically after, say, 5 seconds. Please show me, or do you know any site that can help?

2. I have a Web site. How can you make a particular file on your hard disk available for download when someone visits your site?

- Terry Lee

A Pop-up JavaScript windows can be automatically closed using, not suprisingly, JavaScript. This type of script is complex, and since there's little point in reinventing the wheel, head on over to http://www.javagoodies.com/hellogoodbye.html, where you can grab a free script that will close JavaScript windows. Once you've copied the script to your Web page, you can adjust the length of time the window stays open before closing. Instructions for doing this are at the Javagoodies Web site.

When it comes to putting files on the Web, any type of non-html file, from spreadsheets to multimedia presentations, can be placed on your Web page for visitors to download. This is possible because of the way that Web browsers and servers handle files. Most files are given a file name extension by the program that created them. When a server sends a file to a browser, it attaches some information called a MIME (Multipurpose Internet Mail Extensions) code, which is based on the file extension, and indicates the type of file that it is sending. If the browser recognises the MIME type, it may load and display the file itself, or it may download the file and use the MIME type to pass it to an appropriate helper application. If the browser doesn't recognise the MIME type, it may display a dialogue box that asks the user if they want to save the file or open it.

Here's how to put a non-HTML file on your Web page:

1. Check that you have saved your file with the proper file extension, so that Web browsers and servers will know how to process it. The default file format from most programs is usually OK.

2. Move the file from your hard disk to a directory on your Web server.

3. On your Web page, make a link to the file using the tag and the HREF attribute. For example, Download file. "Zoom.mpg" is the name of the file, and "Download file" is the text that will appear as the link on your page. You may need to specify a directory before the file name according to the directory structure on the Web server and the location of your file. So if zoom.mpg is located in a directory called "movies", the link becomes Download file.

Join the PC World newsletter!

Error: Please check your email address.

Our Back to Business guide highlights the best products for you to boost your productivity at home, on the road, at the office, or in the classroom.

Keep up with the latest tech news, reviews and previews by subscribing to the Good Gear Guide newsletter.

Belinda Taylor

PC World
Show Comments

Most Popular Reviews

Latest News Articles


PCW Evaluation Team

Azadeh Williams

HP OfficeJet Pro 8730

A smarter way to print for busy small business owners, combining speedy printing with scanning and copying, making it easier to produce high quality documents and images at a touch of a button.

Andrew Grant

HP OfficeJet Pro 8730

I've had a multifunction printer in the office going on 10 years now. It was a neat bit of kit back in the day -- print, copy, scan, fax -- when printing over WiFi felt a bit like magic. It’s seen better days though and an upgrade’s well overdue. This HP OfficeJet Pro 8730 looks like it ticks all the same boxes: print, copy, scan, and fax. (Really? Does anyone fax anything any more? I guess it's good to know the facility’s there, just in case.) Printing over WiFi is more-or- less standard these days.

Ed Dawson

HP OfficeJet Pro 8730

As a freelance writer who is always on the go, I like my technology to be both efficient and effective so I can do my job well. The HP OfficeJet Pro 8730 Inkjet Printer ticks all the boxes in terms of form factor, performance and user interface.

Michael Hargreaves

Windows 10 for Business / Dell XPS 13

I’d happily recommend this touchscreen laptop and Windows 10 as a great way to get serious work done at a desk or on the road.

Aysha Strobbe

Windows 10 / HP Spectre x360

Ultimately, I think the Windows 10 environment is excellent for me as it caters for so many different uses. The inclusion of the Xbox app is also great for when you need some downtime too!

Mark Escubio

Windows 10 / Lenovo Yoga 910

For me, the Xbox Play Anywhere is a great new feature as it allows you to play your current Xbox games with higher resolutions and better graphics without forking out extra cash for another copy. Although available titles are still scarce, but I’m sure it will grow in time.

Featured Content

Latest Jobs

Don’t have an account? Sign up here

Don't have an account? Sign up now

Forgot password?