Protecting File Attachments on Web

I have a web application in which I have attached multi-media files to the document in a Rich Text Field, and I use an XML document which is also an attachment to open those media files via a flash player, embeded on the document.

This is working great, but if someone were to view the page source to find the direct link to the XML document (ie, http://server.com/database.nsf/Docid/$File/Document.XML), the XML document would reveal the link to the actual multimedia attachment (http://server.com/database.nsf/Docid/$File/clip.avi).

Is there a way to protect my application so that domino can access these attachment in the course of generating web pages, but prevent them from being directly opened by someone’s browser via the $File URL linking I mentioned above? I need to allow anonymous access to the web site.

Subject: Protecting File Attachments on Web

Not sure why you would want to do this. If the user has access to the content, why does it matter if they can access it directly?

I’m thinking maybe what you really want is not to protect the attachment but to protect the document so the user can’t see anything if they go straight to the document (http://server.com/database.nsf/Docid). If that’s what you really want to do, just add a hide-when to the form that hides everything from Anonymous users. To “hide” the attachments if the user tries to access the document directly, you will need to add a “$V2AttachmentOptions” computed-for-display field that computes to “0”. However this will not prevent them from accessing the attachment directly (http://server.com/database.nsf/Docid/$File/…)

Hope this helps.

Subject: RE: Protecting File Attachments on Web

Thanks for your posting Martin. Hiding the attachments isn’t a problem, I’m doing that by hiding that field from Web browsers.

Subject: RE: Protecting File Attachments on Web

QUOTE: “However this will not prevent them from accessing the attachment directly (http://server.com/database.nsf/Docid/$File/…)”

This is the problem I am having, how do I prevent unauthorized users (being anonymous) from accessing the file directly?