Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

File Saving on Directory vs Database

Posted on 2000-04-27
3
Medium Priority
?
178 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 120 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Ever needed a SQL 2008 Database replicated/mirrored/log shipped on another server but you can't take the downtime inflicted by initial snapshot or disconnect while T-logs are restored or mirror applied? You can use SQL Server Initialize from Backup…
Recently we ran in to an issue while running some SQL jobs where we were trying to process the cubes.  We got an error saying failure stating 'NT SERVICE\SQLSERVERAGENT does not have access to Analysis Services. So this is a way to automate that wit…
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…
Via a live example, show how to shrink a transaction log file down to a reasonable size.

963 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