Hi, I'm building a very simple online store and I need expiring download pages for people to download the items they purchased. Surprisingly, I couldn't find an example of this code online.

I know how to do it in Lasso, and it's quite easy. You just search the database against download attempts or expiration time/date, and if it succeeds, return this (it's Lasso code but you get the idea):

[Output_None]
[Var: 'file' = (Include_Raw: 'pathname/sourcefile.zip')]
[Var: 'filename' = 'product.pdf']
[Var: 'content_type' = 'application/pdf']
[Header]
  HTTP/1.0 200 OK
  Server: Lasso/6.0
  Content-Type: [$content_type]
  Content-Length: [$file->Length]
  Content-Disposition: attachment; filename="[$filename]"
[/Header]
[/Output_None][$file]

Can anyone suggest the PHP code for this?

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Reply via email to