Solved

File Saving on Directory vs Database

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

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Having an SQL database can be a big investment for a small company. Hardware, setup and of course, the price of software all add up to a big bill that some companies may not be able to absorb.  Luckily, there is a free version SQL Express, but does …
Introduction In my previous article (http://www.experts-exchange.com/Microsoft/Development/MS-SQL-Server/SSIS/A_9150-Loading-XML-Using-SSIS.html) I showed you how the XML Source component can be used to load XML files into a SQL Server database, us…
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…
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.

747 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

12 Experts available now in Live!

Get 1:1 Help Now