Forum Moderators: phranque

Message Too Old, No Replies

Script deliver.pl delivers file, but the name should be an other

How to give an other name on the way

         

jetteroheller

4:16 pm on Apr 27, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



There is a download area, where the access is only by deliver.pl

deliver.pl checks for a code, this code is only one hour valid, and delivers the file

In this perl script is to deliver a zip

print "Content-type: application/x-zip\n$deliverfile";

The variable $deliverfile contains the content of the ZIP file

But there is the message box
______________________________________
Do You want to open or store the file?
deliver.pl
______________________________________

But I do not want, that the file is stored as deliver.pl,
I want to give a name like "example.zip"

Any ideas to solve the problem?

jdMorgan

4:33 pm on Apr 27, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



See the Content-Disposition response header. It will allow you to specify the filename.

I'm not sure it's supported by *all* browsers, but it is supported by all of the major ones (and their boutique-brand derivatives) that most of us could name without doing a search.

Jim

httpwebwitch

5:12 pm on Apr 27, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



jdm, do you realize that was your 20001st post? I think you just set off the confetti machines.

g1smd

8:51 pm on Apr 27, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Should you be
print
ing that header, or using the
header
instruction here?

jetteroheller

5:23 am on Apr 28, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



See the Content-Disposition response header. It will allow you to specify the filename.

Much thanks!