class.upload.php is a powerful and mature PHP class to manage uploaded files, and manipulate images in many ways. The script is available under a GPL license.
Hello, I want to take the opportunity to thank Verot for such an excellent script to upload files.
The reason for my message is because I downloaded the latest version available and changed the old file class.upload.php to the new one. At the time of uploading an image I got the error: Fatal error: Class 'Upload' not found in...
I thank who can explain to me the reason why my PHP script does not recognize the call to the class when calling it:
$image = new Upload ($_FILES ["img"]);
With the old file it works without problems, but if I call the new file it immediately generates an error.
I hope someone can give me an answer to solve this problem.
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
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
The reason for my message is because I downloaded the latest version available and changed the old file class.upload.php to the new one. At the time of uploading an image I got the error:
Fatal error: Class 'Upload' not found in...
I thank who can explain to me the reason why my PHP script does not recognize the call to the class when calling it:
With the old file it works without problems, but if I call the new file it immediately generates an error.
I hope someone can give me an answer to solve this problem.
Thank you.
Go to top of the page and add the name space as the first line
https://github.com/verot/class.upload.php#namespacing
works on another project. but in this project it gives an error. The namespace also gives an error. How do I add where.