How to set up: enter email address to download a pdf file

Joseph Sinclair plug-discuss at stcaz.net
Sat Mar 18 18:51:32 MST 2006


If what you're looking to do is let users DOWNLOAD a file by giving
their email, it's really easy, just accept the email information in a
Get/Post, store it somewhere, then respond with the PDF data read from
your file, or from the database if it's multiple different files and
your database supports it.  All you do is set the MIME type header in
the response, then read the file data and write it to the response
stream in reasonable blocks (a few Kbytes at a time) untranslated.  If
you want to get fancy you can even set the filename header so the user's
browser saves it properly.

If you want to allow users to UPLOAD files, then it's actually pretty
trivial to code a module in PHP, Java, ASP, etc... to accept the user
input (incl. a file) in a HTTP PUT request and store it to a (database
or file) location.  If your database supports binary objects, it's
definitely preferred to store the data in the database, since it's a
much safer and better performing solution.

There aren't a lot of examples out there, just because it's so easy to
hand-code, literally around 30-40 lines for a simple implementation (no
security/file verification/etc...).

I'd be happy to provide an example of a Java servlet if that helps...

==Joseph++

joe wrote:

>Can anyone tell me a simple way to set up a routine on my website 
>so people can download a pdf file simply by entering their email 
>address and have the submitted email addresses saved on the web 
>hosting system? 
>
>
>---------------------------------------------------
>PLUG-discuss mailing list - PLUG-discuss at lists.plug.phoenix.az.us
>To subscribe, unsubscribe, or to change  you mail settings:
>http://lists.PLUG.phoenix.az.us/mailman/listinfo/plug-discuss
>
>  
>


More information about the PLUG-discuss mailing list