Hide location of PDF

Posted on 2008-11-11
Last Modified: 2012-05-05
Hi there

We have a back office system developed in ASP.NET which contractors can view all their invoices online. I have just made an addition that allows them to click on a link that opens up a PDF in their browser which displays their invoice as a PDF which they can download.

The problem, however, is that they can manipulate the link in the address bar and thus view someone elses invoice, which we dont want. I can obvioulsy do validation on the page before they are directed to the PDF, but once the PDF opens it has the location on our server in address bar, which they can make a few minor changes to and view someone elses stuff.

Any ideas how I can stop this?

Thanks in advance
Question by:leapingleon
    LVL 18

    Accepted Solution

    Use Response.WriteFile to pass the pdf data itself down to the browser, then they never have access to the file.  Or, place the pdf in a subdirectory so the contractor would have to guess to figure out the location of other PDF files.

    Author Comment

    Thanks, using the writefile method and it looks good.

    Featured Post

    Highfive Gives IT Their Time Back

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    Join & Write a Comment

    This article discusses the ASP.NET AJAX ModalPopupExtender control. In this article we will show how to use the ModalPopupExtender control, how to display/show/call the ASP.NET AJAX ModalPopupExtender control from javascript, how to show/display/cal…
    In this Article, I will provide a few tips in problem and solution manner. Opening an ASPX page in Visual studio 2003 is very slow. To make it fast, please do follow below steps:   Open the Solution/Project. Right click the ASPX file to b…
    This video is in connection to the article "The case of a missing mobile phone (". It will help one to understand clearly the steps to track a lost android phone.
    This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor ( If you're looking for how to monitor bandwidth using netflow or packet s…

    754 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    21 Experts available now in Live!

    Get 1:1 Help Now