MongoDB Advanced Series (--GRIDFS) large file MD5 validation

Source: Internet
Author: User

The MD5 is stored in the Fs.files metadata information after uploading, which is used to verify the MD5 value after the user gets the large file.

The way to view MD5 values in Linux is: md5sum file name

So let's look at the MD5 of the get file from MongoDB and the Gridfs MD5 stored in MongoDB.

[[email protected] ~]$ sudo /usr/local/mongodb/bin/mongofiles put  mongodbbook.tar.gz [sudo] password for neil: connected to: 127.0.0.1added  file: { _id: objectid (' 5508369eb70bc8bfebd8790c '), filename:  " MongodbBook.tar.gz ",  chunksize: 261120, uploaddate: new date (1426601630461),  MD5 :  "85c0c93f51ebe9c609ffe4f9da71c63e",  length: 203 }done! [[Email protected] ~]$ sudo /usr/local/mongodb/bin/mongofiles listconnected to:  127.0.0.1mongodbBook.tar.gz203[[email protected] ~]$ md5sum mongodbBook.tar.gz  85c0c93f51ebe9c609ffe4f9da71c63e  mongodbbook.tar.gz[[email protected] ~]$ rm - rf mongodbbook.tar.gz [[email protected] ~]$ sudo /usr/local/mongodb/bin/ mongofiles get mongodbbook.tar.gzconnected to: 127.0.0.1done write to: mongodbbook.tar.gz[[email protected] ~]$ ll mongobook.tar.gzls:  Unable to access mongobook.tar.gz:  without that file or directory [[email protected] ~]$ md5sum ./mongodbbook.tar.gz  85c0c93f51ebe9c609ffe4f9da71c63e  ./mongodbbook.tar.gz[[email protected] ~]$

MongoDB Advanced Series (--GRIDFS) large file MD5 authentication

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.