CGI pages

When I produce an HTML pages using CGI application, and the user want to save this document, the default file name will be the name of Executable CGI, so how can I assign a name to that page?

Also that problem appear when I download a file using Response.ContentStream, the default name of downloaded file is the name of my CGI.

Is there any way to change that default name?

Motaz
LVL 7
MotazAsked:
Who is Participating?
 
cakkCommented:
try this:

Response.CustomHeaders.Add('Content-Disposition=; filename="Suggested Name.ext"');
0
 
HamidHossainCommented:
Listening ...

I have no Idea Motas,  I think you should change it manually.

Hamid
0
 
EpsylonCommented:
Add something like this in the content:

<head>
<title>The title</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
......
0
Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 
MotazAuthor Commented:
How can I do that in downloaded stream?
0
 
geobulCommented:
Hi Motaz,

  Actually default name is the string after last slash '/'.
  You can set path after the CGI script name like:
  'http://.../ScriptName.exe/motaz'
  In this case the default save name will be 'motaz.html'.

  This path info is used for different web action items in CGI script. If you use default action only, you can use the described way above.

Regards, Geo
0
 
MotazAuthor Commented:
I do not use PathInfo, I leave it empty, is there another way?
0
 
simonetCommented:
My suggestion is also that you use PathInfo.

Alex
0
 
MotazAuthor Commented:
I cann't use PathInfo, if I try to do so, I've to modify whole project (Mail Server)

Motaz
0
 
MotazAuthor Commented:
Hey...
0
 
MotazAuthor Commented:
cakk, it didn't work, it displays random letters instead of the name I was suggested, but I think the solution is around that CustomHeader!

Motaz
0
 
MotazAuthor Commented:
IT WORKS Cakk!!!

Thanks very much, but without Double-Quate ("):

'Content-Disposition=; filename=MyFile.ext');

Thanks very mush. If I have more points I could give it to you, but unfortunately I haven't

Motaz
www.geocities.com/motaz1
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.