using SQL to serve PDF files to IIS thru firewall?

  • Hello all,

    I presently have a SQL Server supplying data using ADO.Net and query strings through a designated SQL port (opened on my Cisco Pix firewall) to an IIS server running my ASP.Net applications and then exposing it all to the web.

    I want to be able to expose PDF files with the SQL Server that's on this side of the firewall to the IIS ASP.Net application on the other side of the firewall, (hopefully using the same connection strings, port, etc.)

    The PDF files are on the machine with the SQL Server.

    I need advise on a basic approach to solve this.

    Should I BLOB the PDF files (they are big, there are lots of them and they change) ?

    Can I just store a link in SQL and somehow reference them, yet send them through my open SQL port?

    Should I "Remote" them somehow or send them "streaming" as binary?

    It seems there should be some basic design solution here that either SQL Server or .NET provides that I'm not seeing.

    All help is appreciated. Thanks in advance.

    Mitch Sanders

     

     

  • Mitch,

    a couple questions to clarify.

    Are you storing the PDF on your SQL Server or just the Box the SQL server is on?

    If it is just as files on the box (which i think it is), then is there a reason you cannot store on the IIS? It is after all the better storage and delivery device.

    I think the usual scenario wouyld be to store the files on the IIS Server, then store links to the files on your sql server. 

    If you are worried about public access to your files then encrypt them and server them only through your web app decrytped.

    YMMV

    Tal McMahon

     

     


    Kindest Regards,

    Tal Mcmahon

  • 1. storage is just on the Box SQL Server is on.

    2. to store the files on the IIS Server would involve breaking several other automatic and workflow systems stubbornly in place.

    3. to replicate the files on the IIS Server would involve firewall, work flow and timing complications difficult to overcome.

    (but I wasn't aware of the ability to encrypt and then decrypt served files... good idea, thanks.)

    still searching.....

  • I think (not a hardware guy) that you could make a vdirectory that pointed to the directory that contains the files.... the caveat being that you would have to open up the firewall to talk to that directory. again I am not a hardware guy.

    you could build a webservice to serve them up on the SQL box if it has IIS on it then open port 80 and query the webservice to get the files.

    If you can store them in the sql server would be the only other option then get the blob data and pass that.  I am not a fan of blob in my sql but microsoft claims it works.

    I would look at a SQL solution as a very last resort.

    tal


    Kindest Regards,

    Tal Mcmahon

  • Thanks Tal,

    I think I've got management talked into the low-tech solution of just moving the files (copying them) onto the IIS server....

    You're right. That's what its better at. Others have suggested the blob approach, but I'm with you on that and would just as soon avoid the overhead and risk.

    thanks,

    mitch

     

     

  • Hi,

    I'm facing the same problem, I have a bunch of changing pdfs on the IIS where my aspx application is hosted. These pdfs are suppose to important files and keeping them on the same server where i'm hosting is kind of risky. Since I can just time in the URL and view the files. Some one once suggested to me about the sub virtual directory, and I tried creating one but if its a network drive I cannot create one.

    Is there a better and secure way of serving pdfs. Any comments on design are welcome.

     

    Thanks,

    Sandeep.

     

Viewing 6 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic. Login to reply