You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Fipamo/brain/api/v1/ImagesAPI.inc.php

31 lines
591 B
PHP

<?php
class ImagesAPI
{
public function __construct()
{
}
public static function uploadImage($request)
{
$image = $request->getUploadedFiles();
$path = date("Y") . "/" . date("m");
$uploadPath = "../public/assets/images/blog/" . $path;
FileUploader::uploadFile($uploadPath, $image["post_image"]);
$response = [
"message" => "Image Added. Very slick",
"type" => "postImageAdded",
"url" =>
"/assets/images/blog/" .
$path .
"/" .
$image["post_image"]->getClientFileName(),
];
return $response;
}
}