how to get blob image in php 24 files jitu

Solutions on MaxInterview for how to get blob image in php 24 files jitu by the best coders in the world

showing results for - "how to get blob image in php 24 files jitu"
Yestin
24 Jan 2018
1<?php
2if (count($_FILES) > 0) {
3    if (is_uploaded_file($_FILES['userImage']['tmp_name'])) {
4        require_once "db.php";
5        $imgData = addslashes(file_get_contents($_FILES['userImage']['tmp_name']));
6        $imageProperties = getimageSize($_FILES['userImage']['tmp_name']);
7        
8        $sql = "INSERT INTO output_images(imageType ,imageData)
9	VALUES('{$imageProperties['mime']}', '{$imgData}')";
10        $current_id = mysqli_query($conn, $sql) or die("<b>Error:</b> Problem on Image Insert<br/>" . mysqli_error($conn));
11        if (isset($current_id)) {
12            header("Location: listImages.php");
13        }
14    }
15}
16?>
17<HTML>
18<HEAD>
19<TITLE>Upload Image to MySQL BLOB</TITLE>
20<link href="imageStyles.css" rel="stylesheet" type="text/css" />
21</HEAD>
22<BODY>
23    <form name="frmImage" enctype="multipart/form-data" action=""
24        method="post" class="frmImageUpload">
25        <label>Upload Image File:</label><br /> <input name="userImage"
26            type="file" class="inputFile" /> <input type="submit"
27            value="Submit" class="btnSubmit" />
28    </form>
29    </div>
30</BODY>
31</HTML>