Archive: http://www.houseoffusion.com/lists.cfm/link=i:4:166684
---
>>How can I prevent unauthorised access to
these directories.?

Hi, I've solved a similar problem this way:
When you upload the pdf file, rename it .cfm instead of .pdf. This way, you can protect them
from being accessed with an application.cfm because they look like CFM templates.
Save the file name in the database, both the original file name and the name used in the server.

When someone wants to download the file, get the file name in a query, say getDoc,
localName is the name of the file saved in the server, filename is the original file name (.pdf)
restitute the pdf status of the file with:
<cfheader name="Content-Disposition" value="attachment; filename=#getDoc.filename#">
<CFCONTENT TYPE="application/octet-stream" FILE="#pathDoc##getDoc.localName#">

This way, the user will receive the original pdf. With this TYPE, the file will not be opened by the browser,
use another type to declare the file as an acrobat file if you want the file to be opened directly.
--
_______________________________________
REUSE CODE! Use custom tags;
See http://www.contentbox.com/claude/customtags/tagstore.cfm
(Please send any spam to this address: [EMAIL PROTECTED])
Thanks.
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

Reply via email to