note 121106 deleted from reserved.variables.files by peehaa
| From: | peehaa@php.net | Date: | Mon, 22 May 2017 07:31:28 +0000 |
| Subject: | note 121106 deleted from reserved.variables.files by peehaa | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-209091@lists.php.net to get a copy of this message | ||
Note Submitter: alekhya05797 at gmail dot com
----
This is the code for s1.php
<!DOCTYPE html>
<html>
<form action="s2.php" 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>
</html>
<!---s2.php-->
<?php
$m = new MongoClient();
$gridfs = $m->selectDB('test')->getGridFS();
$gridfs->storeUpload('pic', array('username' =>
$_POST['username']));
?>
I am trying to store the image in the mongo database.The image is getting stored in the database but
I want the image to be displayed in the front-end.Can anyone help me?
Thanks in advance