?
Solved

CGI question

Posted on 1997-06-05
1
Medium Priority
?
187 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

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

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

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…
In this tutorial I will show you how to provide a dynamic RTF document on your website generated with data from your database. For this tutorial you will need Microsoft Word or WordPad, WhizBase and Microsoft Access. In this tutorial I will show …
Learn the basics of strings in Python: declaration, operations, indices, and slicing. Strings are declared with quotations; for example: s = "string": Strings are immutable.: Strings may be concatenated or multiplied using the addition and multiplic…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
Suggested Courses

777 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