Fatal error: Class 'Upload' not found in

See all posts See thread Reply

Re: Fatal error: Class 'Upload' not found in new!
by Vardan Grigoryan, 4 years, 8 months ago
In the php file where you have added
$image = new Upload ($_FILES ["img"]);

Go to top of the page and add the name space as the first line
namespace Verot\Upload;
Reply
Re: Fatal error: Class 'Upload' not found in new!
by Andres Sepcid, 4 years, 8 months ago
Vardan, thanks for your reply. Indeed, before consulting here I added that line at the beginning of the file and after calling the class. However nothing happened. I must point out that I do not use Composer or Laravel, I program in pure PHP without frameworks. In my case, what should I do to enable that option correctly? A cordial greeting.Reply
Re: Fatal error: Class 'Upload' not found in new!
by Andres Sepcid, 4 years, 6 months ago
It worked for me! Thanks for the help. Today with more time and more calm I followed the steps that you indicated to me to put "namespace Verot \ Upload;" at the beginning of the file that executes the image upload and it worked correctly. I can finally generate WEBP files for my web pages.Reply