Re: File name problem

2001-07-08 Thread Kamelia Popova

At 21:08 07.7.2001 'ã.' +0400, you wrote:
>Hello from Russia
>
>
>How can I set a name for some file? Here is some code from my script.
>
>
>sub set_cyk3{
>my $name=join("",@_);
>$name="date/$name";
>my $c_a="val1=$value1,val2=$value2";
>my $cookie=cookie(-name=>'something',
>-value=>"$c_a",
>-expires=>'+30m');
>print header(-type=>"application/octet-steam",-cookie=>$cookie);
>}

You should send an additional header info:

"Content-Disposition: attachment; filename=yourfilename.ext"

but I don't know how to sent it in CGI header() function. It may be
somewhat like this:

print header(-type=>"application/octet-steam",
 -disposition=>"attachment; filename=yourfilename.ext",
 -cookie=>$cookie);

but not sure. Check in CGI.pm


>&set_cyk3("readme.doc");
>open(FILE, "dirnicecool/readme.doc") || &die("Cant open data file");
>binmode STDOUT;binmode FILE;
>print ;
>close(FILE);
>
>
>The browser promts to save the file with the name "start.cgi"(it is the 
>name of the script) but I want it to be "readme.doc"
>That is the problem.
>
>And what is Content-Disposition ?
>
>
>Excuse my English, it leaves much to be desired.
>
>Please reply to my e-mail box.

Kamelia



_
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com




File name problem

2001-07-07 Thread bizlink

Hello from Russia


How can I set a name for some file? Here is some code from my script.


sub set_cyk3{
my $name=join("",@_);
$name="date/$name";
my $c_a="val1=$value1,val2=$value2";
my $cookie=cookie(-name=>'something',
-value=>"$c_a",
-expires=>'+30m');
print header(-type=>"application/octet-steam",-cookie=>$cookie);
}


&set_cyk3("readme.doc");
open(FILE, "dirnicecool/readme.doc") || &die("Cant open data file");
binmode STDOUT;binmode FILE;
print ;
close(FILE);


The browser promts to save the file with the name "start.cgi"(it is the name of the 
script) but I want it to be "readme.doc"
That is the problem.

And what is Content-Disposition ?


Excuse my English, it leaves much to be desired.

Please reply to my e-mail box.