473,495 Members | 2,058 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

file upload storage - database vs folder

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.
Nov 22 '05 #1
3 2393
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
"R Reyes" wrote:
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.

Nov 22 '05 #2
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.

"Henrik Nordgren" wrote:
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
"R Reyes" wrote:
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.

Nov 22 '05 #3
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:]
"Henrik Nordgren" <He************@discussions.microsoft.com> wrote in
message news:66**********************************@microsof t.com...
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
"R Reyes" wrote:
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.

Nov 22 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
486
by: R Reyes | last post by:
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...
3
13344
by: Karen Grube | last post by:
Hi! Each week, we receive a two-page PDF file from UPS along with a separate flat file (a CSV) The PDF file contains the overview of our weekly invoice and the CSV contains the details of each...
5
4744
by: Grace | last post by:
Hello, I want to upload the file by webpage to SQL Server. When I upload the small file, it is work. But, when I upload big file(ex. 40~50 MB), it isn't work; the Browser displays the...
1
2213
by: Daniel | last post by:
Hi, can u explain to me what is the path need to use in order to upload and download the file based on below solution: 1.Set up a folder that both the web app and SQL server can get to. 2.Do a...
4
5039
by: gpl666666 | last post by:
Does anyone know any free online space which allows user to upload mdb Access database file?
4
6193
by: AshishMishra16 | last post by:
HI friends, I am using the Flex to upload files to server. I m getting all the details about the file, but I m not able to upload it to Server. Here is the code i m using for both flex & for...
3
22021
by: siyaverma | last post by:
i am trying to upload csv file from user's computer to main server the code i am using is if(((isset($_GET)) && ($_GET=="yes")) ) { $typefield = $_GET; echo...
10
1559
by: Redhairs | last post by:
In a web farm environment, how to store the user uploading files for future access? Store them in db, local file system or centralized file server? If trying to storing the file in local file...
6
3815
Jacotheron
by: Jacotheron | last post by:
I need a PHP script that can upload music files (mp3). The script is for a home project I have started a while ago. I have a MySQL database of all the music that I have. Other computers on the...
1
47343
KevinADC
by: KevinADC | last post by:
Note: You may skip to the end of the article if all you want is the perl code. Introduction Many websites have a form or a link you can use to download a file. You click a form button or click...
0
7120
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7196
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6878
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
5456
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
4897
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3088
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3078
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1405
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
286
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.