[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

CGI question

Posted on 1997-06-05
1
Medium Priority
?
189 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 5

Accepted Solution

by:
icd earned 100 total points
ID: 1828183
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

Ask an Anonymous Question!

Don't feel intimidated by what you don't know. Ask your question anonymously. It's easy! Learn more and upgrade.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction This tutorial will give you a fast look what you can do with WhizBase. I expect you already know how to work with HTML at least, and that you understand the basics of the internet and how the internet works. WhizBase is a server-s…
Recently I have been answering a lot of questions like this in IT forums that I frequent. The question posed is usually something along the lines of "We have software X installed and need to uninstall it for reason Y" or some other variant of the sa…
Learn the basics of while and for loops in Python.  while loops are used for testing while, or until, a condition is met: The structure of a while loop is as follows:     while <condition>:         do something         repeate: The break statement m…
The viewer will learn how to dynamically set the form action using jQuery.
Suggested Courses

656 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