Solved

Suggesting a filename to client browser.

Posted on 1997-06-24
7
168 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
3 Use Cases for Connected Systems

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

 
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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

Suggested Solutions

Introduction:   Welcome to my first article ever. To begin with, the reason I write this article.  I participated in a question on Experts Exchange about the start command in Windows and there were some discussion about the usage. The discussio…
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…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

929 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