You are here: Re: Downloading « HTML « IT news, forums, messages
Re: Downloading

Posted by Harlan Messinger on 01/08/08 19:30

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

<a href="this.pdf">This</a>

you'd have

<a href="deliver_pdf?pdf=this">This</a>

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

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация