Solved

File Saving on Directory vs Database

Posted on 2000-04-27
3
174 Views
Last Modified: 2010-08-05
We are working on Application service Provider Project (ASP) and we want to save a file uploaded from the client at the server.

what is the best strategy to save a binary file in this scenerio where the client is a web browser and database is SQL Server 7.0

Now should we save a file which is uploaded from a client in our SQL Server database or we should save this uploaded file in a directory structure created at ASP Server and also what are the pros and cons on both methods and which is the better and why  ?

0
Comment
Question by:sadiqmohd
3 Comments
 
LVL 2

Accepted Solution

by:
highmarks earned 60 total points
ID: 2755812
It is better to store the path of file in database and actual file at that path i.e. ASP directory structure.
Why this because if you store the whole file in DB the size of DB keeps on increasing and so difficult to manage and administer.
Other thing very slow DB access when u try to retrieve that file since it is in binary format and will again have to encode/decode.
Very difficult to take backup of your DB.
And there are many other disadv. also of storing whole file in DB.
It is normal practice to store only path of that file in DB and not whole file.

0
 
LVL 9

Expert Comment

by:cymbolic
ID: 2756872
DITTO (in Caps). Files are blobs. blobs are problems.  Need special methods like getchunk/appendchunk. have had historical bugs in using them in SQL Server.  Not efficient.  No real advantage to placing in database, since you can't content search them quickly on db, but you can if in directory. Don't put the files in your db, just a path/filename.  Might consider adding some index columns for db search capability like, date/time, owner, subject, etc.  Then can do some query without ever going to file.
0
 

Expert Comment

by:t_ogawa
ID: 2757932
There is limitation on number of files  stored in a single directory(folder).
If you save files to directory structure, you may
have to find a way to convert user name or file name to path name.
0

Featured Post

Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Acces SQL Insert Problem 6 32
Parse this column 6 27
SQL - Curser to do an insert based on a select 2 13
Amazon RDS Server load 2 16
Everyone has problem when going to load data into Data warehouse (EDW). They all need to confirm that data quality is good but they don't no how to proceed. Microsoft has provided new task within SSIS 2008 called "Data Profiler Task". It solve th…
This article shows gives you an overview on SQL Server 2016 row level security. You will also get to know the usages of row-level-security and how it works
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
Viewers will learn how to use the INSERT statement to insert data into their tables. It will also introduce the NULL statement, to show them what happens when no value is giving for any given column.

828 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question