PHP Classes

File: uploady/logic/editFileLogic.php

Recommend this page to a friend!
  Classes of Faris AL-Otabi   Uploady PHP Upload File to MySQL   uploady/logic/editFileLogic.php   Download  
File: uploady/logic/editFileLogic.php
Role: Example script
Content type: text/plain
Description: Example script
Class: Uploady PHP Upload File to MySQL
Store file upload details in a MySQL database
Author: By
Last change: refactor
Date: 1 month ago
Size: 1,326 bytes
 

Contents

Class file image Download
<?php

use Uploady\Handler\UploadHandler;

$handler = new UploadHandler($db);

$user_id = $_GET['user_id'];
$file_id = $_GET['file_id'];

if (
$_SESSION['user_id'] != $user_id) {
    die(
"You are not authorized to edit this file");
}

$file = $handler->getFile($file_id);

$file_data = json_decode($file->file_data, true);
$file_settings = json_decode($file->file_settings, true);

$picture = $file_data['directlink'];

$filters = [
   
"Brightness",
   
"Contrast",
   
"Saturation",
   
"Vibrance",
   
"Sharpen",
   
"Blur",
   
"Hue",
   
"Sepia"
];

$effects = [
   
"vintage" => "Vintage",
   
"lomo" => "Lomo",
   
"clarity" => "Clarity",
   
"sinCity" => "Sin City",
   
"crossProcess" => "Cross Process",
   
"sunrise" => "Sunrise",
   
"orangePeel" => "Orange Peel",
   
"love" => "Love",
   
"grungy" => "Grungy",
   
"jarques" => "Jarques",
   
"pinhole" => "Pinhole",
   
"oldBoot" => "Old Boot",
   
"glowingSun" => "Glowing Sun",
   
"hazyDays" => "Hazy Days",
   
"nostalgia" => "Nostalgia",
   
"herMajesty" => "Her Majesty",
   
"hemingway" => "Hemingway",
   
"concentrate" => "Concentrate"
];



$image_mime = [
   
"image/jpeg",
   
"image/png",
   
"image/gif",
   
"image/jpeg",
   
"image/bmp",
   
"image/tiff",
   
"image/x-icon",
   
"image/svg+xml"
];

$title = $lang["general"]['edit_file_title'];