So far in this book we have dealt with data that is mostly textual. But Web 2.0 hardly contains itself within text data. Now we are using web applications to do things that we probably did not think of doing while the World Wide Web was being conceived. For example, watching blockbuster movies, listening to top charted music, uploading and sharing high-resolution pictures snapped with our digital cameras, and all using our web browsers! Where does MongoDB fit in all of this? Is it capable of handling large amounts of binary data? The answer in short, is yes. And in this chapter, we are going to learn how. Mainly we are going to tinker with GridFS, which enables MongoDB to store large files.
So we are going to learn:
What GridFS is
Advantages of using GridFS
How to use PHP to upload files to GridFS
How to serve files from GridFS
When not to use GridFS and why