1

I have a self-made document management system that stores files of all sorts in an SQL database. The database stores 4 basic rows of information, namely:

  • FileID
  • FileName
  • FileSize
  • FileType
  • FileContent

I want to use viewer.JS to preview files, but it requires that I have a URL to access my file, and I have no idea how to assign a URL that would access a file of my choice in a row in a database. I'm building on a home-grown PAAS, thats built on .net.

I've heard that the URL rewrite module for IIS (I'm on 7) may solve my problem, but cant seem to crack it.

Any help on my problem would be much appreciated.

Kara
  • 6,115
  • 16
  • 50
  • 57
Chen_Dogg
  • 91
  • 1
  • 12
  • I ended up transferring out my files and storing them in a directory as opposed to SQL table. URL to access a file in a DB proved too much for me. I also ended up going with an alternative to Viewer.js and that was Prism HTML5 docuemnt viewer. – Chen_Dogg May 21 '14 at 11:50

1 Answers1

0

IMHO IIS rewrite would not help you. Assuming you're using .net, you'd need to build a simple website and use routing in a view.

The url could be something like /Document/{fileid}. when this path is encountered, the router would call your view and you can return the file's content.

Store file in SQL Server database using .Net MVC3 with Entity Framework has some info on a model/controller.

Note: There are some security issues with this approach.

Community
  • 1
  • 1
Laur Ivan
  • 4,117
  • 3
  • 38
  • 62