📜 ⬆️ ⬇️

One of the best classes for uploading files to the server. (Php)

I want to introduce you to one of the best classes, in my opinion, for uploading files to the server.
allows you to do anything with the image
There is nothing better than an example, so immediately to the point ...
We read further if you're interested ...
The simplest example from the site razarbotchika.

$handle = new upload($_FILES['image_field']);
if ($handle->uploaded)
{
// ,

$handle->file_new_name_body = 'image_resized';
$handle->image_resize = true;
$handle->image_x = 100;
$handle->image_ratio_y = true;

$handle->process('/home/user/files/'); //

if ($handle->processed)
{
echo 'image resized'; //
$handle->clean();
} else {
echo 'error : ' . $handle->error; // ( )
}
}


As you can see it is extremely simple and convenient, as well as a demonstration of possibilities .
I use it myself and as they say “I advise everyone”.
')
Download Library

Source: https://habr.com/ru/post/39969/


All Articles