Hi,

On Thu, May 7, 2009 at 3:30 PM, Brendan Brink <[email protected]>wrote:

> Hi there All,
>
> Was wondering if anyone had any experience with selling documents online
> through a shopping cart facility. Ideally, some form of automatic encryption
> etc would be useful. The documents are Word documents and need to maintain
> their functionality as Word documents in order to be edited after the sale.



We've done roughly the following for a client a while ago:

- documents are uploaded and a record of their file name stored in a
database table. All files go into the same folder, but are renamed and
contain the ID of the database table entry in their name. This eliminates
risk of overwriting. The folder is outside/ below the web root of the
website
- users can choose from a list of documents and add these to shopping cart.
Items are added up
- users check out, register/ login and pay for documents (not sure if you
want this explained in mre detail)
- They get a result page with a link to the document. This is of the format:
/download/1/abc.pdf

--> /download is a php file and forced with apche directive <ForceType> to
be processed as php
- looks up ID 1 and checks if this user has paid for this
- reads file from disk and streams it through to browser with fpassthrough()
- important to use abc.pdf at enbd of URL, otherwise some browsers prompt to
save as "index.php" and then not so technical users can't open it.


HTH, Jochen

--~--~---------~--~----~------------~-------~--~----~
NZ PHP Users Group: http://groups.google.com/group/nzphpug
To post, send email to [email protected]
To unsubscribe, send email to
[email protected]
-~----------~----~----~----~------~----~------~--~---

Reply via email to