Still Trying to Find the Best Way to Serve Documents

J

Jonathan Wood

Greetings!

I am still trying to determine the best way to implement a Web site that
contains many documents that visitors can read. Most of the suggestions I've
been given indicate that I should store the documents in a database but then
cache them to pages.

Unfortunately, while an experienced programmer, I've very new to ASP.NET and
the very brief descriptions I've been given how to do this, I just don't
understand.

I would think this is a common task yet I've done a lot of searching the Web
and came up empty. Is there anyone who can provide me with some more
specific information on the best way to implement this?

Thanks!
 
D

Darrel

I would think this is a common task yet I've done a lot of searching the
Web and came up empty. Is there anyone who can provide me with some more
specific information on the best way to implement this?

There is no 'best' way. Just different camps of thought.

Many claim that storing the files in the database is the way to go. It's
easier to maintain, easier to backup, easier to control access.

Others claim that the filesystem was designed specifically for
this...storing and organizing files. So that the way to go is store the
files in the system, and then just reference them in the DB.

I prefer the latter, mainly because it is less abstract. I can SEE the files
right there in the folder. But that's not necessarily a reason that it's a
better method. ;o)

-Darrel
 
J

Jonathan Wood

Hi Darrel,
There is no 'best' way. Just different camps of thought.

I understand, but I'm really new to ASP.NET. I'd just like to see an
approach by someone who understands the technology.
 
B

Bob Lehmann

As Darrel said, people who understand the technology either store the
document in the DB or in the file system.

The *best* way is what works for you.

I'm in the filesystem camp, myself.

Bob Lehmann
 
G

Guest

Jonathan,
As was mentioned, both approaches work -
if you are an experienced programmer and .NET is new to you, the best thing
to do is simply make a decision, and go with it. You can always change it
later, but at this point your objective should be to "get to first base". If
you have issues with the actual code for the implementation, you can always
post here again and get some help.
Peter
 
D

Darrel

I understand, but I'm really new to ASP.NET. I'd just like to see an
approach by someone who understands the technology.

The approach I take is to accept the document, save it to a particular
folder, then put the filename in a DB table.

I often device a categorization system of some sort so all files aren't in
one directory. I then store this categorization in the DB table along with
the file.

So my file table record might look like:

UID: 1111
FileName: my_document.doc
Category: Resumes

Then, to grab the file, I just write out the URL from the data:

/documents/Resumes/my_document.doc

The drawback? Well, deleting or moving a file requires not only updating the
DB, but also the filesystem. Of course, that's not much more then just
adding a couple of functions to handle it, so not a big deal.

-Darrel
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,008
Latest member
HaroldDark

Latest Threads

Top