473,785 Members | 2,424 Online
Bytes | Software Development & Data Engineering Community
+ 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 2413
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.mi crosoft.com> wrote in
message news:66******** *************** ***********@mic rosoft.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 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...
3
13388
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 shipment. I download the file from UPS and then use DTS to import the data into SQL. At that point, I have a Crystal report that prints what looks like a regular UPS invoice. The only problem is that I wind up with having to print two...
5
4771
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 following error message: "The webpage consulted at present is unable to use. Websites may happen the technological question or you need to adjust the browser to establish ."
1
2227
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 simple file upload from the web app what is DTS package and how to apply it? 3.Set up a DTS package to periodically check the folder to do an import. Your help will be appreciated.
4
5064
by: gpl666666 | last post by:
Does anyone know any free online space which allows user to upload mdb Access database file?
4
6227
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 Struts: import java.io.File; import java.io.PrintWriter; import java.util.ArrayList; import java.util.Enumeration; import java.util.Iterator;
3
22053
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 "<form enctype=\"multipart/form-data\" action=\"$PHP_SELF\" method=\"POST\">
10
1584
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 system or centralized file server, how the web server receives the uploading file and sync to each web server's local file system? or the centralized file server?
6
3837
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 network should be able to connect to the database and run queries on the database or upload new music that does not yet exist on the database. The uploaded file's name should be in the following format: ARTIST - TITLE.mp3. I have the code to upload images,...
1
47489
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 on a link and after a moment or two a file download dialog box pops-up in your web browser and prompts you for some instructions, such as “open” or “save“. I’m going to show you how to do that using a perl script. What You Need Any recent...
0
9485
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10356
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10161
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10098
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
7506
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6743
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5523
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3662
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2890
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.