Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Difference between Blob and a file

What is the difference between saving a file (e.g. AVI) as a Blob in the datastore to saving it as a normal AVI file on a webserver?

Thanks!

Joel

like image 418
Joel Avatar asked Aug 03 '10 08:08

Joel


1 Answers

A file saved in on the server will be a usual file system file. But, in databases they have tables to save data. So, when you want to save a file in a database, there is a special field which is Binary Large Objects (BLOB) field. Which allows a stream of bytes to be stored into the database just like any other fields. It does not store what type of the file is and any other attributes that the file system may be maintaining. You must know the type of file when reading back from database. Which is usually stored into some other text field into the same table.

like image 121
decyclone Avatar answered Sep 18 '22 13:09

decyclone