Solved

Suggesting a filename to client browser.

Posted on 1997-06-24
7
176 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
[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
  • 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
Containers and Docker for Everyone

Containers are an incredibly powerful technology that can provide you and/or your engineering team with huge productivity gains. Using containers, you can deploy, back up, replicate, and move apps and their dependencies quickly and easily.

 
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

What Is Transaction Monitoring and who needs it?

Synthetic Transaction Monitoring that you need for the day to day, which ensures your business website keeps running optimally, and that there is no downtime to impact your customer experience.

Question has a verified solution.

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

Active Directory replication delay is the cause to many problems.  Here is a super easy script to force Active Directory replication to all sites with by using an elevated PowerShell command prompt, and a tool to verify your changes.
A quick Powershell script I wrote to find old program installations and check versions of a specific file across the network.
Learn the basics of if, else, and elif statements in Python 2.7. Use "if" statements to test a specified condition.: The structure of an if statement is as follows: (CODE) Use "else" statements to allow the execution of an alternative, if the …
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

728 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