Downloading
am 07.01.2008 20:17:13 von Sheldon Glickler
I want to be able to download a file. If the file is a zip or an exe,
the user is asked where to save the file and the download proceeds.
However, if the file is a pdf, the pdf displays and doesn't bring up the
save as box.
I do not want the pdf to display. Rather, I want to have it bring up
the save as box. i do not want to first zip up the pdf and force the
user to unzip it.
Is this possible?
If so, how is this done?
I did Google searches for "download pdf file" and "download pdf file
'save as'" but they didn't reveal any answers.
Shelly
Re: Downloading
am 07.01.2008 20:21:15 von Harlan Messinger
Sheldon Glickler wrote:
> I want to be able to download a file. If the file is a zip or an exe,
> the user is asked where to save the file
I'm confused. First you say that *you* want to be able to download a
file, and then you imply that you're talking about someone else.
> and the download proceeds.
> However, if the file is a pdf, the pdf displays and doesn't bring up the
> save as box.
>
> I do not want the pdf to display.
If you're the user, then right-click the link (assuming IE or Firefox on
Windows) and choose the option to save the link to your computer. If you
aren't the user, then who are you to decide that the user wants to
download the PDF to his hard drive?
> Rather, I want to have it bring up
> the save as box. i do not want to first zip up the pdf and force the
> user to unzip it.
Why do you want to force the user to do anything except use his browser
in the way in which he's accustomed to using it?
Re: Downloading
am 07.01.2008 21:43:55 von Sheldon Glickler
Harlan Messinger wrote:
> Sheldon Glickler wrote:
>> I want to be able to download a file. If the file is a zip or an exe,
>> the user is asked where to save the file
>
>
> I'm confused. First you say that *you* want to be able to download a
> file, and then you imply that you're talking about someone else.
The customer wants to limit the number of downloads and he doesn't want
the pdf to display to the user. He wants the user to display it on his
own after he has downloaded it. I know this is silly since once the
user has downloaded the file, he can always copy it to any number of
machines, but the customer IS the customer.....
>
>> and the download proceeds. However, if the file is a pdf, the pdf
>> displays and doesn't bring up the save as box.
>>
>> I do not want the pdf to display.
>
> If you're the user, then right-click the link (assuming IE or Firefox on
> Windows) and choose the option to save the link to your computer. If you
> aren't the user, then who are you to decide that the user wants to
> download the PDF to his hard drive?
I am not the user.
>
> > Rather, I want to have it bring up
>> the save as box. i do not want to first zip up the pdf and force the
>> user to unzip it.
>
> Why do you want to force the user to do anything except use his browser
> in the way in which he's accustomed to using it?
That is what the customer spec called for -- and he is paying the bill.
--
Shelly
Re: Downloading
am 07.01.2008 22:30:41 von Harlan Messinger
Sheldon Glickler wrote:
> Harlan Messinger wrote:
>> Sheldon Glickler wrote:
>>> I want to be able to download a file. If the file is a zip or an
>>> exe, the user is asked where to save the file
>>
>>
>> I'm confused. First you say that *you* want to be able to download a
>> file, and then you imply that you're talking about someone else.
>
> The customer wants to limit the number of downloads and he doesn't want
> the pdf to display to the user. He wants the user to display it on his
> own after he has downloaded it. I know this is silly since once the
> user has downloaded the file, he can always copy it to any number of
> machines, but the customer IS the customer.....
If site is for use by the customer's employees, then the customer can
have the employees' browsers configured to prompt the user. If it's for
your customer's customers, it isn't any of *his* business and it doesn't
make any sense anyway. Have you tried discussing this with your
customer? Maybe you have, but I'm always surprised by the number of
people who assume outright that customers never want to hear advice and
feedback from the knowledgable people performing work for them. A
constructive approach is not to criticize the instructions but to point
out likely *consequences* that "you may not have thought about", including:
* consequences that may be undesirable
* consequences that will be at odds with other stated
purposes of the customer himself
* consequences that will eliminate any perceived benefit
* the consequence that the requested feature won't actually
have the effect that the customer assumed it would
have when he requested it, which means he'll be
spending money for nothing
I haven't always convinced the customer by following this approach, but:
* it has often helped clarify things
for customers that weren't
previously clear to them,
* I have often directed customers
to solutions that they like better
than the ones they had conceived
for themselves,
* I have often gotten a better understanding
of why they requested *their* approach,
which helped me do a better job of
fulfilling the request OR of making an
even *better* counter-suggestion,
* I have usually gotten credit for being
helpful and attentive--the customers
have liked knowing that I'm paying
attention, and
* the response has never been "How dare you
question me?" and has rarely been even
milder form of that retort.
In your case, has your customer considered the possibility that not all
his users will be able to find a file after having downloaded it? What
is their level of sophistication?
It isn't clear to *me* how prompting the user to save the files will
have the effect of limiting the number that they download. Is it clear
to you? Anyway, the way to accomplish that is by linking to a
pass-through routine rather than to the documents themselves, one that
keeps either a session counter (if the limit is per-session) or a
database-based counter (if the limit is per authenticated user) and
checks it before feeding the content of the document to the user.
Re: Downloading
am 08.01.2008 00:01:40 von jeff
Sheldon Glickler wrote:
Tinker with the Content-disposition you send, change it to attachment.
I suppose you could also change the content-type so the users
computer wouldn't know what to do with and would be forced to save.
Try the content-disposition first, as it is the correct way to do that.
Jeff
> Harlan Messinger wrote:
>> Sheldon Glickler wrote:
>>> I want to be able to download a file. If the file is a zip or an
>>> exe, the user is asked where to save the file
>>
>>
>> I'm confused. First you say that *you* want to be able to download a
>> file, and then you imply that you're talking about someone else.
>
> The customer wants to limit the number of downloads and he doesn't want
> the pdf to display to the user. He wants the user to display it on his
> own after he has downloaded it. I know this is silly since once the
> user has downloaded the file, he can always copy it to any number of
> machines, but the customer IS the customer.....
>
>>
>>> and the download proceeds. However, if the file is a pdf, the pdf
>>> displays and doesn't bring up the save as box.
>>>
>>> I do not want the pdf to display.
>>
>> If you're the user, then right-click the link (assuming IE or Firefox
>> on Windows) and choose the option to save the link to your computer.
>> If you aren't the user, then who are you to decide that the user wants
>> to download the PDF to his hard drive?
>
> I am not the user.
>
>>
>> > Rather, I want to have it bring up
>>> the save as box. i do not want to first zip up the pdf and force the
>>> user to unzip it.
>>
>> Why do you want to force the user to do anything except use his
>> browser in the way in which he's accustomed to using it?
>
> That is what the customer spec called for -- and he is paying the bill.
>
Re: Downloading
am 08.01.2008 04:50:18 von rf
"Sheldon Glickler" wrote in message
news:qKOdnZ18uLaEEh_anZ2dnUVZ_urinZ2d@giganews.com...
> Harlan Messinger wrote:
>> Sheldon Glickler wrote:
>> > Rather, I want to have it bring up
>>> the save as box. i do not want to first zip up the pdf and force the
>>> user to unzip it.
>>
>> Why do you want to force the user to do anything except use his browser
>> in the way in which he's accustomed to using it?
>
> That is what the customer spec called for -- and he is paying the bill.
Then you must tell the customer that whatever the spec calls for it still
has no control over what the users browser does.
--
Richard.
Re: Downloading
am 08.01.2008 17:50:41 von Sheldon Glickler
Harlan Messinger wrote:
> Sheldon Glickler wrote:
>> Harlan Messinger wrote:
>>> Sheldon Glickler wrote:
>>>> I want to be able to download a file. If the file is a zip or an
>>>> exe, the user is asked where to save the file
>>>
>>>
>>> I'm confused. First you say that *you* want to be able to download a
>>> file, and then you imply that you're talking about someone else.
>>
>> The customer wants to limit the number of downloads and he doesn't
>> want the pdf to display to the user. He wants the user to display it
>> on his own after he has downloaded it. I know this is silly since
>> once the user has downloaded the file, he can always copy it to any
>> number of machines, but the customer IS the customer.....
>
> If site is for use by the customer's employees, then the customer can
> have the employees' browsers configured to prompt the user. If it's for
> your customer's customers, it isn't any of *his* business and it doesn't
> make any sense anyway. Have you tried discussing this with your
> customer? Maybe you have, but I'm always surprised by the number of
I had already passed on this information to my bossthat the customer's
request is silly. He said he had talked with them, but that is what
they wanted.
> people who assume outright that customers never want to hear advice and
> feedback from the knowledgable people performing work for them. A
> constructive approach is not to criticize the instructions but to point
> out likely *consequences* that "you may not have thought about", including:
>
> * consequences that may be undesirable
> * consequences that will be at odds with other stated
> purposes of the customer himself
> * consequences that will eliminate any perceived benefit
> * the consequence that the requested feature won't actually
> have the effect that the customer assumed it would
> have when he requested it, which means he'll be
> spending money for nothing
>
> I haven't always convinced the customer by following this approach, but:
>
> * it has often helped clarify things
> for customers that weren't
> previously clear to them,
> * I have often directed customers
> to solutions that they like better
> than the ones they had conceived
> for themselves,
> * I have often gotten a better understanding
> of why they requested *their* approach,
> which helped me do a better job of
> fulfilling the request OR of making an
> even *better* counter-suggestion,
> * I have usually gotten credit for being
> helpful and attentive--the customers
> have liked knowing that I'm paying
> attention, and
> * the response has never been "How dare you
> question me?" and has rarely been even
> milder form of that retort.
>
> In your case, has your customer considered the possibility that not all
> his users will be able to find a file after having downloaded it? What
> is their level of sophistication?
>
> It isn't clear to *me* how prompting the user to save the files will
> have the effect of limiting the number that they download. Is it clear
> to you? Anyway, the way to accomplish that is by linking to a
> pass-through routine rather than to the documents themselves, one that
> keeps either a session counter (if the limit is per-session) or a
> database-based counter (if the limit is per authenticated user) and
> checks it before feeding the content of the document to the user.
Can you explain this "pass-through" routine?
Re: Downloading
am 08.01.2008 17:54:32 von Sheldon Glickler
rf wrote:
> "Sheldon Glickler" wrote in message
> news:qKOdnZ18uLaEEh_anZ2dnUVZ_urinZ2d@giganews.com...
>> Harlan Messinger wrote:
>>> Sheldon Glickler wrote:
>
>>> > Rather, I want to have it bring up
>>>> the save as box. i do not want to first zip up the pdf and force the
>>>> user to unzip it.
>>> Why do you want to force the user to do anything except use his browser
>>> in the way in which he's accustomed to using it?
>> That is what the customer spec called for -- and he is paying the bill.
>
> Then you must tell the customer that whatever the spec calls for it still
> has no control over what the users browser does.
More to the point, once the user downloads the file even ONCE, he can
copy it to as many machines as he wants, email to whomever he wants,
make a CD and give it away, etc. My customer has NO control over that,
but he still insists.
Re: Downloading
am 08.01.2008 18:09:10 von Sheldon Glickler
Jeff wrote:
> Sheldon Glickler wrote:
>
> Tinker with the Content-disposition you send, change it to attachment.
>
> I suppose you could also change the content-type so the users computer
> wouldn't know what to do with and would be forced to save.
>
> Try the content-disposition first, as it is the correct way to do that.
Thanks for the suggestion. I googled and found
http://support.microsoft.com/kb/260519
which says:
You can use the content-disposition header to override this default
behavior. Its format is:
Content-disposition: attachment; filename=fname.ext
> Jeff
>> Harlan Messinger wrote:
>>> Sheldon Glickler wrote:
>>>> I want to be able to download a file. If the file is a zip or an
>>>> exe, the user is asked where to save the file
>>>
>>>
>>> I'm confused. First you say that *you* want to be able to download a
>>> file, and then you imply that you're talking about someone else.
>>
>> The customer wants to limit the number of downloads and he doesn't
>> want the pdf to display to the user. He wants the user to display it
>> on his own after he has downloaded it. I know this is silly since
>> once the user has downloaded the file, he can always copy it to any
>> number of machines, but the customer IS the customer.....
>>
>>>
>>>> and the download proceeds. However, if the file is a pdf, the pdf
>>>> displays and doesn't bring up the save as box.
>>>>
>>>> I do not want the pdf to display.
>>>
>>> If you're the user, then right-click the link (assuming IE or Firefox
>>> on Windows) and choose the option to save the link to your computer.
>>> If you aren't the user, then who are you to decide that the user
>>> wants to download the PDF to his hard drive?
>>
>> I am not the user.
>>
>>>
>>> > Rather, I want to have it bring up
>>>> the save as box. i do not want to first zip up the pdf and force
>>>> the user to unzip it.
>>>
>>> Why do you want to force the user to do anything except use his
>>> browser in the way in which he's accustomed to using it?
>>
>> That is what the customer spec called for -- and he is paying the bill.
>>
Re: Downloading
am 08.01.2008 18:49:39 von Bergamot
Sheldon Glickler wrote:
>
> The customer wants to limit the number of downloads and he doesn't want
> the pdf to display to the user.
As soon as the visitor clicks the link it's going to be downloaded,
whether it automatically opens with a pdf reader or not. There's no
difference in the number of downloads here, so there is no limiting
involved.
If the customer really wants to limit the number of downloads, require
user registration before they even see a link to the file. That will
discourage arbitrary downloads by casual surfers.
--
Berg
Re: Downloading
am 08.01.2008 19:21:59 von sheldonlg
Bergamot wrote:
> Sheldon Glickler wrote:
>> The customer wants to limit the number of downloads and he doesn't want
>> the pdf to display to the user.
>
> As soon as the visitor clicks the link it's going to be downloaded,
> whether it automatically opens with a pdf reader or not. There's no
> difference in the number of downloads here, so there is no limiting
> involved.
>
> If the customer really wants to limit the number of downloads, require
> user registration before they even see a link to the file. That will
> discourage arbitrary downloads by casual surfers.
>
This, I have already handled. The user buys the manual and is given a
randomly generated, eight character (from among the 62) key. To get at
the file, he will have to click on the download page after entering the
key. I then check the key and the product_id, drop the available number
of downloads, and offer the download.
--
Shelly
Re: Downloading
am 08.01.2008 20:30:35 von Harlan Messinger
Sheldon Glickler wrote:
> Harlan Messinger wrote:
>> Sheldon Glickler wrote:
>>> Harlan Messinger wrote:
>>>> Sheldon Glickler wrote:
>>>>> I want to be able to download a file. If the file is a zip or an
>>>>> exe, the user is asked where to save the file
>>>>
>>>>
>>>> I'm confused. First you say that *you* want to be able to download a
>>>> file, and then you imply that you're talking about someone else.
>>>
>>> The customer wants to limit the number of downloads and he doesn't
>>> want the pdf to display to the user. He wants the user to display it
>>> on his own after he has downloaded it. I know this is silly since
>>> once the user has downloaded the file, he can always copy it to any
>>> number of machines, but the customer IS the customer.....
>>
>> If site is for use by the customer's employees, then the customer can
>> have the employees' browsers configured to prompt the user. If it's
>> for your customer's customers, it isn't any of *his* business and it
>> doesn't make any sense anyway. Have you tried discussing this with
>> your customer? Maybe you have, but I'm always surprised by the number of
>
> I had already passed on this information to my bossthat the customer's
> request is silly. He said he had talked with them, but that is what
> they wanted.
>
>> people who assume outright that customers never want to hear advice
>> and feedback from the knowledgable people performing work for them. A
>> constructive approach is not to criticize the instructions but to
>> point out likely *consequences* that "you may not have thought about",
>> including:
>>
>> * consequences that may be undesirable
>> * consequences that will be at odds with other stated
>> purposes of the customer himself
>> * consequences that will eliminate any perceived benefit
>> * the consequence that the requested feature won't actually
>> have the effect that the customer assumed it would
>> have when he requested it, which means he'll be
>> spending money for nothing
>>
>> I haven't always convinced the customer by following this approach, but:
>>
>> * it has often helped clarify things
>> for customers that weren't
>> previously clear to them,
>> * I have often directed customers
>> to solutions that they like better
>> than the ones they had conceived
>> for themselves,
>> * I have often gotten a better understanding
>> of why they requested *their* approach,
>> which helped me do a better job of
>> fulfilling the request OR of making an
>> even *better* counter-suggestion,
>> * I have usually gotten credit for being
>> helpful and attentive--the customers
>> have liked knowing that I'm paying
>> attention, and
>> * the response has never been "How dare you
>> question me?" and has rarely been even
>> milder form of that retort.
>>
>> In your case, has your customer considered the possibility that not
>> all his users will be able to find a file after having downloaded it?
>> What is their level of sophistication?
>>
>> It isn't clear to *me* how prompting the user to save the files will
>> have the effect of limiting the number that they download. Is it clear
>> to you? Anyway, the way to accomplish that is by linking to a
>> pass-through routine rather than to the documents themselves, one that
>> keeps either a session counter (if the limit is per-session) or a
>> database-based counter (if the limit is per authenticated user) and
>> checks it before feeding the content of the document to the user.
>
> Can you explain this "pass-through" routine?
>
For example, instead of
you'd have
The file deliver_pdf (or the file it refers to if it's aliased by the
web server) will have server-side code that does more less the following
(in extreme pseudo-code):
limit = [number of downloads permitted]
soFar = [number of downloads so far]
if (soFar >= limit)
set Response.ContentType to "text/html"
send web content that includes a message,
"Sorry, you've reached your download limit"
else
set Response.ContentType to "application/pdf"
open this.pdf as a LOCAL BINARY FILE that isn't on the website
binary-read the contents of this.pdf
binary-write the contents to the Response object
close this.pdf
increase the stored number of downloads so far by 1
end if