mirror of
https://github.com/Aviortheking/Blog_IMIE.git
synced 2025-06-15 03:29:19 +00:00
pouet mise a jour pouet
This commit is contained in:
@ -1,24 +1,24 @@
|
||||
<?php
|
||||
|
||||
|
||||
// if(isset($_GET["image"]) && !empty($_GET["image"])) $_POST["image"] = $_GET["image"];
|
||||
if(isset($_GET["image"]) && !empty($_GET["image"])) $_POST["image"] = $_GET["image"];
|
||||
|
||||
// $id = 1; //post id
|
||||
$id = 1; //post id
|
||||
|
||||
// $uploadFolder = "../../uploads/posts/$id/";
|
||||
$uploadFolder = "../../uploads/posts/$id/";
|
||||
|
||||
// if(!file_exists($uploadFolder)) {
|
||||
// mkdir($uploadFolder, 0660, true);
|
||||
// }
|
||||
if(!file_exists($uploadFolder)) {
|
||||
mkdir($uploadFolder, 0660, true);
|
||||
}
|
||||
|
||||
// if(isset($_FILES["photo"]) && !empty($_FILES["photo"])) {
|
||||
// var_dump($_FILES["photo"]);
|
||||
// move_uploaded_file($_FILES["photo"]["tmp_name"], $uploadFolder.$_FILES["photo"]["name"]);
|
||||
// // require_once "functions.php";
|
||||
// // file_put_contents($uploadFolder."/pouet.jpg", base64_decode($_POST["image"]));
|
||||
// // base64_to_jpeg($_POST["image"], $uploadFolder."/pouet.jpg");
|
||||
// // file_put_content($uploadFolder."/pouet.jpg", base64_decode(preg_replace('#^data:image/\w+;base64,#i', '', $_POST["image"])));
|
||||
// }
|
||||
if(isset($_FILES["photo"]) && !empty($_FILES["photo"])) {
|
||||
var_dump($_FILES["photo"]);
|
||||
move_uploaded_file($_FILES["photo"]["tmp_name"], $uploadFolder.$_FILES["photo"]["name"]);
|
||||
// require_once "functions.php";
|
||||
// file_put_contents($uploadFolder."/pouet.jpg", base64_decode($_POST["image"]));
|
||||
// base64_to_jpeg($_POST["image"], $uploadFolder."/pouet.jpg");
|
||||
// file_put_content($uploadFolder."/pouet.jpg", base64_decode(preg_replace('#^data:image/\w+;base64,#i', '', $_POST["image"])));
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user