Solved

File Saving on Directory vs Database

Posted on 2000-04-27
3
172 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

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Question has a verified solution.

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

JSON is being used more and more, besides XML, and you surely wanted to parse the data out into SQL instead of doing it in some Javascript. The below function in SQL Server can do the job for you, returning a quick table with the parsed data.
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Via a live example, show how to extract information from SQL Server on Database, Connection and Server properties
Via a live example, show how to backup a database, simulate a failure backup the tail of the database transaction log and perform the restore.

911 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now