Solved

Suggesting a filename to client browser.

Posted on 1997-06-24
7
166 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
Comment Utility
Edited text of question
0
 
LVL 2

Accepted Solution

by:
Voodoo earned 100 total points
Comment Utility
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
Comment Utility
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
Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

 
LVL 8

Author Comment

by:mrmick
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

In this tutorial I will aim to show you how simple is making a small application in WhizBase, how to add, remove and update data in the DB. I will make a small address book application where you can add, browse, update and remove addresses. I wi…
Batch, VBS, and scripts in general are incredibly useful for repetitive tasks.  Some tasks can take a while to complete and it can be annoying to check back only to discover that your script finished 5 minutes ago.  Some scripts may complete nearly …
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…

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

12 Experts available now in Live!

Get 1:1 Help Now