I believe, every one would choose the one he knows/uses. I use Codeigniter, that's why I choose it. However, I'm planning to start learning Laravel soon. And I'd love to learn it from your courses as CI4 of Udemy, it was a great course. Hope, you could create a laravel course on Udemy soon. Thanks for your valuable courses, straightforward way of teaching clean and best practice code.
Dear Dave. You lessons are just excellent. You have a talent of explaining things in the most clear and consise way possible. Thanks for that. I managed to learn so much thanks to your videos and look forward to learn even more.
Thank you very much Sir. I really was happy to discover your channel, the way you teach is excellent and make me understand PHP more. I hope you to make a simple tutorials in Laravel framework for us. I really thank you Sir♥
Thanks for the tutorial, it was understandable. Will you ever make a video about uploading larger files (in chunks maybe)? Or that isn't a job that php and post requests can handle?
I'm also having this problem of uploading my file into the destination directory , but i'm kinda getting an error mr dave got, someone help me please 🤯
Hi Dave, The PHP finfo Class, did you install the package yourself? I didn't find it in the Extensions section of my PHP.ini file. And, sadly, when I tried to use it in my Script, I got this message: finfo::file(application/pdf): Failed to open stream: No such file or directory How please, may I solve this?
The extension was installed by default when I did it. Are you using an older version of PHP perhaps? The extension is called "fileinfo" - it depends on your system how to install it, try searching for that extension for your particular system. Having said that, an upgrade to the latest version of PHP might fix it, as it should be installed by default.
@@dave-hollingworth Ah! Dave, thank you. The fileinfo extension is installed. But, I was looking for finfo! I am running PHP 8.2. Yet to upgrade to 8.3 due to PHPMyAdmin issues. Meaning, I will seek the solution to my error elsewhere. Again, thank you very much.
I'm also having this problem of uploading my file into the destination directory , but i'm kinda getting an error mr dave got, someone help me please , i remember him saying it was out of the scope of the video😰
Thank you so much for your great explanation. I just have a question. You said that when the file is in the temp folder at that point the file has been uploaded to the server, so Isn't it dangerous that the file has been uploaded to the server? for exaple if the file is malicious or for instance if it's mime type has been spoofed? I mean a malicious file that is in the PHP temporary folder/memory could cause damage to the server?
Potentially, for example if someone has gained terminal access to the server, they could access the uploaded file in the temporary folder and execute it if it were a malicious executable. However most of the time files in the temporary folder just remain there until you move it to a more permanent location, or the folder is emptied by the operating system (which it does on a regular basis). It's only a risk if the server has already been compromised.
Hi @Dave Hollingworth, Thanks for the video , its very helpful for me. But I am facing a priblem that I cannot see the image file into my target directory and I am also not seeing any error like upload failed. I am using windows 10 and I also tried uploading by changing the permission of the target folder to allow everyone to full control,change and read. But still no luck. Can you please help me with this issue.
Try a different folder, or an absolute path to the folder you're trying to save the upload to; also check the filename and path, make sure they don't contain any invalid characters
Warning: move_uploaded_file(C:\Users\amine\Desktop\php leasons\upload/upload/ananas.JPG): Failed to open stream: No such file or directory in C:\Users\amine\Desktop\php leasons\upload\upload.php on line 37 Warning: move_uploaded_file(): Unable to move "C:\xampp\tmp\php4B87.tmp" to "C:\Users\amine\Desktop\php leasons\upload/upload/ananas.JPG" in C:\Users\amine\Desktop\php leasons\upload\upload.php on line 37 can't move file
A master class, thank you. I'd read the php manual pages on file uploads and was surprised how much is there. You have managed to cover and implement the most excellent summary I could have hoped for and cleared up a lot of confusion. Please keep on with these most excellent basics of php. Thanks again.
Great video Dave, thanks for al the information, I know you mentioned that going over permission is out of the scope of this video, would you have a video where do you go over these? Currently my folder is set to 755 as well as the parent, but the "if ( ! move_uploaded_file($_FILES["fileToUpload"]["tmp_name"], $destination)){" condition keeps failing ... my guess is permission, or would there be a better way to troubleshoot?
@@dave-hollingworth i just see it now. it's great but the form is without attachment and i'm using wordpress not localhost. if you have a tutorial that could help me in my case it would be great. tnx again