update : 2015.11.03
php.shukuma.com검색:
|
MongoGridFS::storeUpload(PECL mongo >=0.9.0) MongoGridFS::storeUpload — Stores an uploaded file in the database 설명인수
반환값Returns the _id of the saved file document. This will be a generated MongoId unless an _id was explicitly specified in the
오류/예외Throws MongoGridFSException if there is an error reading the uploaded file(s) or inserting into the chunks or files collections. 변경점
예제Example #1 MongoGridFS::storeUpload() HTML form example Suppose you have the following HTML form: <form method="POST" enctype="multipart/form-data"> <label for="username">Username:</label> <input type="text" name="username" id="username" /> <label for="pic">Please upload a profile picture:</label> <input type="file" name="pic" id="pic" /> <input type="submit" /> </form> If you wanted to store the uploaded image in MongoDB, you could do the following in the script handling the form submission:
<?php 참고
|