Solved

CGI question

Posted on 1997-06-05
1
181 Views
Last Modified: 2013-12-25
I would like users to be able to download files from my web site, without showing them the URL of the file.  I can hide the URL in the HTML code, but the browser the user has will display the file's URL. With HTML files I provide my customers, I call an .asp script to write the file to the browser, thus hiding the html file name, but I haven't figured out how to do this when downloading files. I've looked at .asp methods as well as perl. Maybe there is some way to write the binary stream out to the browser! Thanks in advance if you can help.
0
Comment
Question by:ebuescher
1 Comment
 
LVL 5

Accepted Solution

by:
icd earned 50 total points
Comment Utility
I would approach this by writing a script (in perl) that opens the file to download and outputs it to stdout, effectively this will output it to the browser.

The main issue will be that the browser will be expecting a particular mime type. Some types the browser will deal with itself, such as text or gif images. For those types that the browser does not know about it will prompt if the user wants to save the file. For example exe files are handled this way.

If it was an exe file that was being downloaded then you would output the following prior to outputting the exe file.

print "Content-type: application/octet-stream\n\n";

This would result in the user being prompted where to save the file to. Unfortunately you will also find that the default file name will be the name of the script, there is no way to change this default.

0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

In this tutorial I will focus on how to use WhizBase as a tool for sending ICQ messages to ICQ. Here I will use a new technology in WhizBase, published in WhizBase 5.1 version. In this tutorial I will use 3 files, pager.wbsp for the processing, e…
This tutorial will discuss the log-in process using WhizBase. In this article I assume you already know HTML. I will write the code using WhizBase Server Pages, so you need to know some basics in WBSP (you might look at some of my other articles abo…
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now