Solved

Suggesting a filename to client browser.

Posted on 1997-06-24
7
171 Views
Last Modified: 2013-12-25
I'm developing a cgi application which offers many files for download - each with a unique password.  I use the following logic:

1) Client requests file.
2) Return HTML form requesting the password.
3) Upon verifying the password, send the file.

When I return the file, I send in the HTTP header:

Content-Type: application/octet-stream

Everything works fine except...

My Question: How can I suggest a filename to the browser instead of having the browser derive one from the original url (ie. the name of the script)?
0
Comment
Question by:mrmick
  • 5
  • 2
7 Comments
 
LVL 8

Author Comment

by:mrmick
ID: 1828521
Edited text of question
0
 
LVL 2

Accepted Solution

by:
Voodoo earned 100 total points
ID: 1828522
You add an extra header, in addition to your content type:

print "Content-type: application/octet-stream\n";
print "Content-Disposition: inline; filename=$filename\n\n";

This will do it.
0
 
LVL 8

Author Comment

by:mrmick
ID: 1828523
Voodoo,

1) Excellent for Netscape, any way to get the same results with MSIE?

2) Do you happen to know the RFC for the version of HTTP with this specification? (I have copies of 0.9, 1.0 & 1.1 only)

0
How our DevOps Teams Maximize Uptime

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us. Read the use case whitepaper.

 
LVL 8

Author Comment

by:mrmick
ID: 1828524
Voodoo,

Please do not answer the second question if it requires you to do any research at all; I'm only seeking the RFC if you happen to have the number handy.

I am hoping to find a way to get the same results with MSIE though, but regardless of what else you may have to offer - I'll still consider this question successfully answered.

mrmick

0
 
LVL 2

Expert Comment

by:Voodoo
ID: 1828525
I don't have the exact number, but you may be able to find it at the following URL:

http://www.oac.uci.edu/indiv/ehood/MIME/MIME.html

Hope this helps...

0
 
LVL 8

Author Comment

by:mrmick
ID: 1828526
Do you have any idea how I can suggest a filename to MSIE?

I'll go ahead and grade the answer if you'd like, but I'd prefer to wait if you think you might come up with something.

mrmick
0
 
LVL 8

Author Comment

by:mrmick
ID: 1828527
Ok, well thanks for what you were able to provide.  I'm still looking for a solution to this issue in regard to MSIE.
0

Featured Post

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

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…
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 the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…

825 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