Тёмный
No video :(

PHP $_FILES and Handling File Uploads 

Steve Griffith - Prof3ssorSt3v3
Подписаться 102 тыс.
Просмотров 6 тыс.
50% 1

When you are dealing with uploading files from a webpage there are many moving parts that you need to keep track of. There are always security concerns too.
This video talks about how to use the $_FILES superglobal array and shows some best practices for dealing with file uploads.
CODE GIST: gist.github.co...
Video on PHP.ini file: • What the php.ini File ...

Опубликовано:

 

23 авг 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 24   
@LoneWolf-gl8sk
@LoneWolf-gl8sk 3 года назад
thanks prof. I tried to google about those 5 properties that each file have. didn't find any until I found this video. thank you again.
@SteveGriffith-Prof3ssorSt3v3
@SteveGriffith-Prof3ssorSt3v3 3 года назад
Php.net is the official documentation site. It has everything you need.
@lestercutchall2275
@lestercutchall2275 2 года назад
Steve, you are the absolute S^^^! I watched all your tutorials on MySQL and built the back side for my site. Now I'm watching the PHP videos in order to learn how to tie it into my front side. If weren't for your calm, precise manner, I wouldn't have been able to get this far. You are helping to make a dream come true. THANK YOU!!!
@seancolaco9587
@seancolaco9587 Год назад
Amazing explanation!!
@eduardoranierosilva
@eduardoranierosilva 2 года назад
the "enctype="multipart/form-data"" really saved me, thanks!!!
@skrumb
@skrumb 3 года назад
Love your commentary lad!
@user-sr9nh3lc2x
@user-sr9nh3lc2x 10 месяцев назад
Thank you for sharing this amazing video with us . I would like to ask you where should i save the uploaded pictures,files on mac os ?can i create folder wherever i want?Thank you
@SteveGriffith-Prof3ssorSt3v3
@SteveGriffith-Prof3ssorSt3v3 10 месяцев назад
Yes. you can create folders whereever you want and call them any valid folder name. Move your files from the tmp folder into your own once they are uploaded.
@gabrielgodoy7846
@gabrielgodoy7846 2 года назад
Excellent videos!!! What keyboard do you use?
@SteveGriffith-Prof3ssorSt3v3
@SteveGriffith-Prof3ssorSt3v3 2 года назад
I've used many different keyboards. Most videos are either with the MacBook Pro built-in keyboards or an Apple usb one.
@gabrielgodoy7846
@gabrielgodoy7846 2 года назад
@@SteveGriffith-Prof3ssorSt3v3 Thanks for answering... when I can, I'm going to buy a Macbook :) On the other hand, I love the way you explain. I am now watching the PHP tutorial. Congratulations!!!
@hakami1426
@hakami1426 Год назад
So quick question, is the directory where the PHP saves the files to, technically the server? Bc I know a server is just a computer somewhere
@SteveGriffith-Prof3ssorSt3v3
The server is the computer where the web server runs. The web server is the program that handles all the requests and responses. The web server uses the PHP program to run the php scripts. PHP saves files in a folder on the server.
@rangel3l1
@rangel3l1 2 года назад
I have a form and I would like only files of the type gif can be accepted, how can I do that in an easy way of course.
@SteveGriffith-Prof3ssorSt3v3
@SteveGriffith-Prof3ssorSt3v3 2 года назад
The type property of the uploaded file gives you the mime-type. So "image/gif" is the mime type you are looking for.
@rootdev7644
@rootdev7644 3 года назад
What about with arrays n multi file uploads??
@SteveGriffith-Prof3ssorSt3v3
@SteveGriffith-Prof3ssorSt3v3 3 года назад
$_FILES is a multi-dimensional array. Each uploaded file has an entry with all those 5 properties.
@quicksketch1617
@quicksketch1617 4 года назад
How can I solve with node.js, any link or tutorial to search?
@SteveGriffith-Prof3ssorSt3v3
@SteveGriffith-Prof3ssorSt3v3 4 года назад
I have a video where I talk about doing an HTTP Request from Node to get a file, bringing it back and saving it on the server. It is a similar basic process as receiving one that is uploaded. ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-rh7opViDFMo.html
@aadil4236
@aadil4236 3 года назад
I'm uploading a file and its error status is 0 which mean all is well but i can't view that file in that temp_name location in xamp This is the location : C:\xamp\tmp\php6855.tmp I checked that location in file explorer but i can see my uploaded file there Is it normal..?
@SteveGriffith-Prof3ssorSt3v3
@SteveGriffith-Prof3ssorSt3v3 3 года назад
The temp files are only kept as long as needed. When your script finishes running the temp file can be deleted. If you do nothing with the file it will definitely disappear right away
@aadil4236
@aadil4236 3 года назад
But I'm using move_uploded_file() to move it into different directory right away (I'm using absolute path to move the file) , but its showing an error of "cannot move to (provided location)" and I'm printing the global file array variable afterwards to check for the error number it still gives 0 i don't know what am i doing wrong.
@aadil4236
@aadil4236 3 года назад
I even checked the owner of the directory and php user by echoing out `whoami`; the owner of the directory and the php user are same and i gave the user write permission in that directory but it still doesn't work.
@rasmitamaryam6979
@rasmitamaryam6979 2 года назад
thank you for the video, but ur animation slide is not good :)
Далее
PHP - foreach Loops and Associative Arrays
6:13
Просмотров 18 тыс.
Session Management Intro with PHP
19:32
Просмотров 11 тыс.
What the php.ini File Does
9:39
Просмотров 8 тыс.
File Upload Progress Bar Meter Tutorial HTML5 Ajax PHP
24:39
Download Progress Monitoring with SVG Animation
32:14
Просмотров 1,3 тыс.
Stop Writing So Many Tests
10:02
Просмотров 87 тыс.
Important differences between textContent and innerText
11:44