Solved

File Saving on Directory vs Database

Posted on 2000-04-27
3
176 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Optimize your web performance

What's in the eBook?
- Full list of reasons for poor performance
- Ultimate measures to speed things up
- Primary web monitoring types
- KPIs you should be monitoring in order to increase your ROI

Question has a verified solution.

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

Why is this different from all of the other step by step guides?  Because I make a living as a DBA and not as a writer and I lived through this experience. Defining the name: When I talk to people they say different names on this subject stuff l…
Load balancing is the method of dividing the total amount of work performed by one computer between two or more computers. Its aim is to get more work done in the same amount of time, ensuring that all the users get served faster.
Using examples as well as descriptions, and references to Books Online, show the documentation available for date manipulation functions and by using a select few of these functions, show how date based data can be manipulated with these functions.
Via a live example, show how to extract information from SQL Server on Database, Connection and Server properties

628 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