Great Video !! If anyone is facing an issue where files are not seen in uploads folder on a Mac then go to uploads folder , right click ->get info and set permissions to read and write
I'll just go ahead and pin this comment for others to see :) and thank you for sharing, I don't use Mac so I wouldn't have been able to figure this out.
I am facing an issue like when I click upload button it's going to upload.php. But the file is not in uploads folder and there is no any successful msg. Please hlp me
The topic is hard for a new php coder like me. But the entire video is well explained with a great detail. I think I couldn't learn and do in a proper way without your nice tutorial. Love and respect.
YOU ARE A LIFE SAVER. I looked this up on another website and my brain got cooked but your explanation is so simple even my monkE brain could understand. Thank you so much.
Best tutorial ever. Genuinely saved me hours of time. I dont usually comment on videos, but had to based on how comprehensively the tutorial was posted. Thanks alot for posting!!
Another Great Upload even though it's from past hehe. Also i am noticing that in this videos ur doing quite a bit of nesting which u clearly said isn't a very good thing to do in ur recent uploads . Now i can actually see why. keep updating us
When will the next PHP tutorial arrive? Could really use some knowledge on how to create profile pages, specific data/descriptions/profile pictures etc. for specific users :) It would help a lot!
I got a bit behind todays episode because of other plans, but I am planning on recording and uploading an episode today on creating profile images for users :)
Thanks to content providers like you I have a new career as a web developer at the ripe age of 54 lol. Can't thank you enough for all the free content and flawless delivery. Your channel is truly amazing and inspiring!
I'm 29 and moving in same direction. After an injury im changing my carreer. And seeing you at this age i think i can do it as well. Just a lot of stuff to learn. Scary.
I had some young chump female ask why I want to do IT.... LIKE I DONT BELONG HERE... this witch needs to know started before she could suck on a baby bottle.... now I'm knee deep... and learning it all... once done I will be a full stack... I'm now I'm a honor student... stfu brat
for developers: never trust what user sends, questionable everything what user sends. On this video its not problem, but what if user sends file with name ".jpg" to your script, or "../index.php" or "index.php .jpg" ( means newline character) if you use blacklist to disallow some file extensions uploads, check what extensions are executable on server config; What if someone uploads "innocentfile.phtml"? (yes, phtml is executable on default apache2+php setup)
This doesn’t make any sense, though hackers can upload executables then run it on the server (technically they couldn’t because they wouldn’t have permissions) the file name here is renamed and the extension is checked for. On top of that you have pointed the file to a location on the server so it won’t go anywhere else. The method shown here is fine in real world production.
For a beginner tutorial, this is alright. But Thasan is right, for a production website, you must implement solutions against potential hacker attacks. Let's say i have a png image and i replace the extension from "png" to "gif". That doesn't make my png image being a gif image. The image is still a png image, because the name of any file (including extension) doesn't tell anything of the file. Therefor you must check the header of the uploaded image. Hint: check out this php function: exif_imagetype
very helpful vedio..nice step by step description Thankyou!! and please create a vedio on " how to upload vedio through a web page in database or some folder" including back end programming.
Dani, this has been a very helpful tutorial that I've used in a project I'm working on. It works wonderfully. However, in addition to uploading a file to a separate folder in my root directory , I'd like to be able to insert the file path of the uploaded file into a table I've created into a mysql database. I'm struggling to sort out how to code that into my php file.
hello sir, may you help me with this trouble, i'm trying to upload my image files into my website image folder, how can I connect it? thank you in advance
Your tutorial is one of the best, the clearest explained. I'm truly thankful for this great resource you provide for us. A simple function, a thorough instruction.
Please explain the function uniqid(" ", true) Confused on why should you supply empty string as first parameter and boolean true as another 2nd parameter parameter...what these parameters gotta do or what are these parameters instructing uniqid() function to do by taking them?? Btw great tut!
Just a tip: your file extension type is checking just the name of the file - it doesn't mean it's an actual image file. Instead, I would recommend using mime_content_type() to check the actual file type. $filetype = mime_content_type($_FILES['file']['tmp_name']); if(($filetype !== 'image/png' && $filetype !== 'image/jpeg')){ die("Not a gif/jpeg/png"); }
for those that got an undefined index error for $_FILES - double check all syntax and code 'grammar'. I left out the dash in form-data in the enctype attribute in tags. mine read:
Non-PHP-Programmers: PHP SUCKS! *But they watched this video to see how to create a File Uploader in PHP And they still Complain that PHP Sucks. (320K views and very sure most of the viewers have talked negatively about PHP)
I have followed most of your lessons and i have learnt a lot, But there is one thing that is giving me hell and i want to know please help. How do i upload an image file and audio file in the same database row with mysqli and php at once or at different times but in the same row. You really good at teaching and thanx in advance.
To get this to work you need have the folder "uploads" in the source directory. Also right click on the uploads folder for Mac and get info. Change the permissions for the folder to allow read and write. On windows I am sure it is the same. Need to adjust the permissions of the folder.
Hey try this !! Go to xampp config , locate php.ini file find for upload_max_filesize variable and increase the size. Then your images will move to dest folder. This might help you !!
Danial trhank so much for all your efforts and precious time to make these awesome series and all your tutorials. May I request you to make a video on how to upload csv and txt file into mysql table and how to validate the file. Your help is really appreciated and can save my life. Thank you so much in advance. Here is Sharifa your usual student.
i would like to know myself. the only thing i could think of is that the files are now sitting in the uploads folder, visible to anyone who requests the directory, unless you disable directory browsing
The code actually works for you? Did everything he did in the video and for some reason code is not working, it displays the error->You cannot upload files of this type.
It is a copy of what he did, since im learning, i do copy of his code.. and when i submit an image, whatever kind of those placed in the allowed array, it prints out error
hey man, I subscribed your channel after 30 day's surfing on it. Buddy you really deserve it. Good and easy way to teach using understandable techniques.
Thanks for your tutorials, I hope you can feature next video how to make POINT OF SALES in PHP. just a simple one. I love your explaination, very clear.
Thank you so much for all these tutorials. They are really important for a person just starting out learning about php! You explain really well and slowly. So thank you a lot!
FOR MAC USERS make sure the uploads folder is read & writable. it is read only by default because many xampp folders are defaulted that way. Right click folder, click get info, unlock, change to read and write, now it should work. Thats why windows users are saying success while mac users are pulling their hair out.
How can we block the user from uploading image which has more than 250px of height and more than 250px of width? Can anyone please help me about this? Thank you.
I have a question. I don't get it how the data inside the file got moved up all the way to $fileNewName. Was the data inside the uploaded file in the $fileExtension variable? and got it moved all the way to $fileNewName? Or is the file data inside the extension?
thanks for the content it's really useful, but i have one question, what happens if i dont use the "$allowed"? my system will allow all kind of files? and if want to add another extension like for example .pkt , I just have to add it to the allowed array? hope someone can help me with this
OK I found problem and solution to it :) It was max file size in php.ini. So everyone who has such problem should find php.ini file in xampp and modyfi - upload_max_filesize=2M (just set it to higher number)
you are a awesome man ! thank you Sir! may Allah Bless You ! your explanations are so easy to understand . i have learned from you so many things . thanks a lot.
Very helpfull Video. Exactly what I needed. When talking about Bytes please use 'B' in capital. You talk about bytes but on the screen you use 'kb' which is kilo bits not bytes, which makes a difference and sometimes gets confusing. Otherwise great Video!
Man thank you so much for teaching this, I was looking like crazy to how to do things like that and I coudn't find a good way to do it, I even did one by myself but wasn't a good soluction using javascript API FileReader(); and send it to my server as a data64 '-', that was a mess. thank you so much.
Greate video as usual, I have a problem though and I need some help, I have a PHP application that allow upload of excel files into DB, I want the PHP to deny upload any excel file that has been edited or opened after imported from the source system, in other words, I want the PHP to accept only the excel files that has not been modified by any user since imported from the source system.
So the upload.php file wouldn't be considered a kind of "include" like what you've shown for the header? You'd want that in the main root folder? Thank you for the tutorial, by the way. I'm learning a lot.