コード例 #1
0
ファイル: image_ajax.php プロジェクト: neevan1e/Done
 foreach ($_FILES['photos']['name'] as $name => $value) {
     $filename = stripslashes($_FILES['photos']['name'][$name]);
     $size = filesize($_FILES['photos']['tmp_name'][$name]);
     //Convert extension into a lower case format
     $ext = getExtension($filename);
     $ext = strtolower($ext);
     //File extension check
     if (in_array($ext, $valid_formats)) {
         //File size check
         if ($size < MAX_SIZE * 1024) {
             $actual_image_name = time() . $filename;
             $tmp = $_FILES['photos']['tmp_name'][$name];
             //Moving file to uploads folder
             if (move_uploaded_file($tmp, $path . $actual_image_name)) {
                 $data = $FbWall->Image_Upload($uid, $actual_image_name);
                 $newdata = $FbWall->Get_Upload_Image($uid, $actual_image_name);
                 if ($newdata) {
                     //echo '<img src="data:image/jpg;base64,'.$newdata['image_base'].'" class="preview" id="'.$newdata['id'].'"/>';
                     $upload_id .= $newdata['id'] . ",";
                     echo "<img src='uploads/" . $actual_image_name . "'  class='preview' id='" . $newdata['id'] . "'/>";
                 }
             } else {
                 echo '<span class="imgList">You have exceeded the size limit! so moving unsuccessful! </span>';
             }
         } else {
             echo '<span class="imgList">You have exceeded the size limit!</span>';
         }
     } else {
         echo '<span class="imgList">Unknown extension!</span>';
     }
 }
コード例 #2
0
 <?php 
error_reporting(0);
include_once 'includes/db.php';
include_once 'includes/FbWall.php';
include_once 'includes/tolink.php';
include_once 'includes/time_stamp.php';
include_once 'session.php';
$FbWall = new FbWall();
if (isset($_POST['webcam'])) {
    $newdata = $FbWall->Get_Upload_Image($uid, 0);
    echo "<img src='uploads/" . $newdata['image_path'] . "'  class='webcam_preview' id='" . $newdata['id'] . "'/>";
}