|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
|
|
Stay one step ahead of the competition. Evaluate and give feedback
on some of the hottest web development tools on the market today.
Make your opinion heard! Click
Here
|
|
#1
|
|||
|
|||
|
directory or DB ??
Hi,
which one is a better way to store files submitted by users ? upload and store in a directory or as a blob field in database ? thanks,
__________________
Rathaur ====================== Knowledge is Power |
|
#2
|
|||
|
|||
|
In a directory - it becomes easier to manage. Not only that, if your database dies, you still have access to the files.
A lot of forums store their avatars in the database, and this is alright because avatars are quite small. |
|
#3
|
|||
|
|||
|
How abt user submitted files, that could be in any format, whether a .ppt , .xls, .html, .doc is it still suitable to use DB or should I use directoris ? for example if a file is 400KB, 10 files will cost me 4M and 100 files 40M . in case of DB, will blob will reduce the amount of memory that used to store the files ?
thanks, appreciate you guys suggestion .. |
|
#4
|
|||
|
|||
|
No, you still need the same amount of space regardless of how you store it: it all comes down to the number of bytes.
You could gzcompress the files first, and then store them on your filesystem - then gzuncompress them when somebody calls for them. But you'll be better off going with flat files for something like that. You don't want to make too many unnecessary database calls. |
![]() |
| Viewing: Dev Articles Community Forums > Programming > General Programming Help > directory or DB ?? |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|