file upload storage - database vs folder

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

what are the pros/cons of uploading a file into a database (like access, sql
server, oracle) vs. uploading a file into a folder (and only storing its path
in a database table) ?

i've never had to upload a file into a database and am assuming it's easier
to just put files in a folder with its path stored in the database. storing
a file in the database seems like a bit more work and is just "another
solution" rather than a recommended one.

ideas and comments please? thanks.
 
I have used both techniques whilst working with oracle database.

And it all comes down to the scenario. But generally I want to keep my data
in as few places as possible, for security reasons, and for availability
reasons. And it is nothing complicated about storing a binary file in a BLOB
field in the database. You can still read it while working with datasets.. it
is serialized and encoded using Base64. And I do't like to store paths in
database, becuase then you create a depencence between the file system and
the application. And this is not good from an architectural point of view.

Of course when you need a third party application to access the file, then
perhaps the best choice would be to store the file in a shared folder. If it
can't be solved in any other way.. I always consider file systems as a last
resort...

but thats just me ;) Im no MVP or MCAD...

kind regards
Henrik
 
ok, but what if i plan to look at the files a lot (which are mostly images)?
this code is for a personal site (not a production) and i like to see the
image files every now and then (for whatever reason). is it hard to view
files manually or must i run some code to parse from the database just to
view these files all the time? if there's a way for the database to show me
the pictures w/o me having to run code that would be great!

thanks for your help it's most appreciated.
 
This has been the topic of many discussions amongst many web people :]

One question though. Suppose I do store my images for a web site in a BLOB
inside my DB. When I get a request for a web page that contains a few
images, don't I need to point the client browser somewhere to fetch those
files ? Won't I be forced to create a page (script, HttpHandler, call it
what you want ) that returns the image data from the database with the
proper header/content type info ? Isn't this overkill in the case you just
need to display a pic on a web site ?

Angel
O:]
 
Back
Top