Can you describe the full way of working with images.from <input type="file"> to saving the image in the folder. Will it be enough to use Image class or I should use Upload class too.
Or, please, put an example here. Thank you very much!
Your working on a PHP installation that is not according to the standards. PHP 5.3+ should have the finfo module installed by default. If this is locally, you should fix your installation. If this is a hoster, kick him in the nuts for not providing a standard installation.
If you're on Windows, you need to activate the finfo dll in your PHP config, it's not added by default.
Assuming you have setup your configuration correctly, the first thing you do is run Upload::process().
After that, you can call Upload::get_errors(), to see if there were any processing errors. This call returns an array with an array for every file uploaded, and all information about the file, including all detected errors.
If you don't have any errors, continue by calling Upload::save(). Again, after this call get_errors() so see if you had any errors while saving the uploaded files.
Just play a bit with it, do some var_dumps to check what data is returned, to get a feel for how it works.
p.s. It's pretty pointless checking the value of a constant in an if. :-)
One simple question. Image was uploaded. I want to resize it and put resizet copy to another folder (origin file must be saved). Please, tell me how to do it. For resizing - class Image. Should I use for copy File class or there is possibility in Image class to save new image in another folder?