PHP File Uploads | The Complete Guide to Uploading Files Using PHP

preview_player
Показать описание
Please consider supporting my channel:

Learn how to upload a file using PHP.

Full PHP course:

In this video you'll learn how to:
• create a form in HTML to select files for upload
• configure PHP for file uploads
• save the file locally to the web server
• restrict files by size and type
• rename uploaded files for security
• avoid overwriting existing files

Code shown in the video:

CSS:

PHP Documentation shown:

00:00 Introduction
00:31 HTML form
01:30 PHP script
02:27 $_FILES
05:02 Upload errors
06:50 Restricting size
10:30 Restricting by type
12:52 The temporary file
13:40 Move the file
16:20 Filename security
17:42 Unique filenames
19:03 Summary

#PHP #files #HTML #upload
Рекомендации по теме
Комментарии
Автор

What's your preferred PHP framework (including no framework at all)?

dave-hollingworth
Автор

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.

ilkinshafiyev
Автор

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.

batchrocketproject
Автор

Nice work Dave! I love the way you delve deep into the sub-levels of PHP

abdullahikabri
Автор

Thank you! I am getting practice on PHP and learning English by watching your videos!!!🤝

ilya___
Автор

This lesson saved me time and effort trying to understand this whole process myself. This guide was easy to understand, and easy to follow along with.

AndrewMycol
Автор

your videos have changed me a lot ... Thanks.

kalebmulugeta
Автор

Thank you, I really appreciate this high-quality content!

cdaaniel
Автор

Very informative video. Saved me lots of time studying the docs. Thanks!

jcdeaton
Автор

Thanks that was a really good tutorial, I now have a much better understanding of the error codes.

SprintsNClimbs
Автор

Codeigniter!
I took your class on Udemy!! 🙌

someutubchannel
Автор

man i cant lie your videos are amazing clear and easy to understand thanks alot boss

odjirighodalil-lqow
Автор

Brilliant video tried implementing this image.1 image.2 image.3 will try unlinking too. Thanks man waiting for update of your MVC course

tanzimibthesam
Автор

Thanks for creating such an informative tutorial on PHP :)

microsoftgaming
Автор

You are awesome, man. Thanks for helping <3

mohammadabuobaidamullick
Автор

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♥

sadjednemli
Автор

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?

theevilapple_
Автор

This was very very very informative and helpful 👍🏾. God bless you in Jesus Mighty Name 🙏🏾

michaelchiz
Автор

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?

MrSfaundez
Автор

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?

alexanderdelagarza