Тёмный

PHP File Uploading 

Codecourse
Подписаться 340 тыс.
Просмотров 138 тыс.
50% 1

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

 

17 окт 2024

Поделиться:

Ссылка:

Скачать:

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

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 126   
@Dani_Krossing
@Dani_Krossing 9 лет назад
This is the first RU-vid tutorial on file upload I have found which actually makes sense. Thanks
@AhmadRaza-wi7sy
@AhmadRaza-wi7sy 3 года назад
aaaareeey chlaaey niii sady haan tee we zalim ah
@KM-sf6zy
@KM-sf6zy 3 года назад
so is yours too, your videos helps me a lot on learning php specially the mvc one.
@devlinthornicroft9975
@devlinthornicroft9975 9 лет назад
Works great. Thanks Alex and PHP Academy. Seems like almost every video you guys post is easy to follow and actually works.
@embersajt2593
@embersajt2593 5 лет назад
FInally somebody explained us how to do this! Thank you very much for this! For those people who's project is not working properly, please make sure you setted the next permission on the "uploads/" folder on linux. (chmod 0777 uploads/) It allowes your site to create files into the folder.
@yuan3234
@yuan3234 4 года назад
Yow bro thanks alot !!
@nanaparker_
@nanaparker_ 2 года назад
Thanks a lot! This was really helpful
@NDHFilms
@NDHFilms 4 года назад
Here's a little thing that tripped me up: when you're testing it out, make sure you are loading your pages from the server, and not from your computer's file directory. If you are opening the files locally, when you click the 'upload' button, it is going to open the php file, and just show you the code you wrote. If you are using Windows, you'll want the url to start with localhost, not C/Program%20Files or something similar.
@dXXPacmanXXb
@dXXPacmanXXb 9 лет назад
Is it possible to upload a file via a string that was given to the script per POST-Method? So like the post-info "file" is "C:/.../file.txt" and then the file file.txt gets uploaded. So that I don't have to use a file browser but just copy the directory as a string in a form for example?
@trakeshkumar
@trakeshkumar 6 лет назад
thanks bro...out of all youtube videos for file uploading only this one worked thanks a lot
@lfoxforl3232
@lfoxforl3232 9 лет назад
So u can upload files in ur local website folder...but is there a way u can upload a file into a folder on a online host like *awardspace?
@clusion1405
@clusion1405 3 года назад
samething
@rodrickngonyoku5042
@rodrickngonyoku5042 4 года назад
Bravo.!!..just bravo!!!...simple,short,brief and informative...Thank You Very Very Much!!!
@heriblandt
@heriblandt 8 лет назад
I have used this video to make an upload project but for mp3's however that seems really unstable, even after I have added quite a few different mp3-types to the array. Any suggestions? For now I work in localhost
@lifeonearth9490
@lifeonearth9490 4 года назад
Dear Sir, thank you for sharing.May I know where the uploaded files will be saved?If there are many files from the public, the space may be full on our PC.
@dxb_coder
@dxb_coder 6 лет назад
Best file uploading tutorial so far....thanx
@mrigankpawagi
@mrigankpawagi 7 лет назад
Thanks a lot man!!! No online tutorial was helping me, but you! Thanks a lot!
@wadwdaaafefawfawawfawerog4335
@wadwdaaafefawfawawfawerog4335 7 лет назад
but what if 2 ppl upload a file with the same name EXACTLY at the same time.. wont it break and overwright one of the files.
@mohammedjammeh3299
@mohammedjammeh3299 7 лет назад
Thank you very very much for these tutorials. You've been saving my life for the past couple of days.
@brprelude2012
@brprelude2012 10 лет назад
maybe I didn't see this but are the only extensions allowed txt and jpg?
@007KrausBean
@007KrausBean 10 лет назад
Awesome. I'm trying to learn about loading images to a MySQL database into as a BLOB and then recalling it to a page from the Database. Do you have a video about that? If so, I have not found it yet.
@espheroz
@espheroz 8 лет назад
i can see it in the folder on bracket software but there is nothing on the desktop folder please help
@MarkGoldfain
@MarkGoldfain 3 года назад
Beautifully presented. Thanks!
@AnotherKentPaul
@AnotherKentPaul 9 лет назад
Why is there no filesize when uploading a jpg or png file? The size array always says 0?
@BillBodkin
@BillBodkin 9 лет назад
+AnotherKentPaul same, and my file wont upload
@Eddygeek18
@Eddygeek18 10 лет назад
Just tried it and it's returning the $file_name_new as .txttxt? EDIT: Never mind realised i was still using print_r($file_ext); underneath the code.
@thoughtyness
@thoughtyness 8 лет назад
Haha! Same thing happened to me.
@YanneckMeyer
@YanneckMeyer 7 лет назад
Great Tutorial! Thank you. Finally I created my script, connected with a lot of inputs. Works so great together :)
@ZacharyBeers
@ZacharyBeers 10 лет назад
this was a lot easier than i was expecting, thanks!
@slidejones6033
@slidejones6033 5 лет назад
So clear and easy to understand. Thanks
@jasonivanpaguio8633
@jasonivanpaguio8633 6 лет назад
Works locally but i needed to upload to my hosting server and it doesnt allow me to please help
@FestusMuberuka
@FestusMuberuka 8 лет назад
That Ending Though
@frknens0
@frknens0 3 года назад
How can I find out path of the selected file?
@_romeopeter
@_romeopeter 6 лет назад
Thank you so much for this, this makes so much sense, keep making good and understandable videos like this!
@cyrusplaton9824
@cyrusplaton9824 7 лет назад
move_uploaded_file() expects parameter 1 to be string, array given in C:\xampp\htdocs\arms\upload.php on line 30 i have this error. help please :(
@Hoogleyboogleynetwork
@Hoogleyboogleynetwork 7 лет назад
Send me a link to your code.
@BlaBlah000
@BlaBlah000 8 лет назад
does this work locally for example with WAMP, or only when files are uploaded to the server.
@aseemlalfakawma5084
@aseemlalfakawma5084 7 лет назад
works locally
@emmanuelalfred354
@emmanuelalfred354 7 лет назад
you just earned yourself a new follower. Awesome overall
@GePree00
@GePree00 9 лет назад
thank you! Very easy to follow and works like a charm!
@ahmelq
@ahmelq 10 лет назад
Hey alex , i don't think this work on mobiles !
@mnageh-bo1mm
@mnageh-bo1mm 4 года назад
any idea how to send a post request to upload.php and got it to save it ?
@illeone5433
@illeone5433 3 года назад
Thank you very much for the tutorial, very helpful.
@lars_vs
@lars_vs 9 лет назад
great video, actually sticks to the point
@gustavowalteroslarrotta7798
@gustavowalteroslarrotta7798 7 лет назад
thanks, good work, form the other side of the planet, i only speak spanish but i can undertand your method, thanks friend.
@KN0CK0UT91
@KN0CK0UT91 9 лет назад
this is just amazing man. totally works. Thanks THANKs... THANKKSSSSSS
@adamfay940
@adamfay940 6 лет назад
Thanks for the help, the only video I could find that helped me.
@TOminerTV
@TOminerTV 7 лет назад
The last if construct does not work, no error message no output, no upload, nothing!
@japjap6406
@japjap6406 8 лет назад
do you have a tutorial for an image only ?
@석순달
@석순달 7 лет назад
Nookummoogliepums Smoochiedumpling
@shivshankar654
@shivshankar654 6 лет назад
can we upload the file without temporary file
@DANJUMA9
@DANJUMA9 10 лет назад
How would you do this via OOP?
@kabrau08
@kabrau08 9 лет назад
Thank you very much, you are a great instructor. Sorry for my English.
@jacksonabernathy1683
@jacksonabernathy1683 7 лет назад
BRaulio Herrera your English was perfect
@tagKnife
@tagKnife 10 лет назад
Too many unneeded variables. once you copy $_FILES['file'] to $file Using the $file array is enough you dont need to assign more variables... This would be a good time to make a video about references/pointers
@codecourse
@codecourse 10 лет назад
Thanks for the comment, it just made things clearer and if they're required again they would be useful - but you're right, in this example they're not absolutely required.
@emmanueleden1930
@emmanueleden1930 9 лет назад
this doesnt work for me when i add mp3 or mp4. i dont know why :(
@nookummoogliepumssmoochied7458
+emmanuel eden have you tried adding these file types here? $allowed= array('txt', 'jpg', 'pdf', 'doc');
@shreyaraj7brollno.286
@shreyaraj7brollno.286 9 лет назад
You are great my lord! You are so amazing man.
@jetongjonbalaj972
@jetongjonbalaj972 6 лет назад
Does this work on online servers?
@teamunicornproductions.5825
@teamunicornproductions.5825 9 лет назад
sir do you have a download video ?
@johnelias8976
@johnelias8976 7 лет назад
Notice: Undefined variable: files in /storage/ssd2/642/2185642/public_html/upload.php on line 4
@johnelias8976
@johnelias8976 7 лет назад
oh nvm i put files xd
@tsigilis
@tsigilis 10 лет назад
what server do you use?
@pathros425
@pathros425 9 лет назад
+Αλέξανδρος Τσιγγίλης In min 3:31 you can read it: MAMP. But later on Alex made a video about Laravel's homestead.
@japjap6406
@japjap6406 8 лет назад
is this not vulnerable for double extension ? name.php.txt ? or something ?is this safe enough for a website ?
@searchbarwebs
@searchbarwebs 8 лет назад
Indeed. This is NOT secure for production/live/testing websites. i repeat. DO NOT USE IT!!!
@japjap6406
@japjap6406 8 лет назад
+Sam Host can you explain me why ? in detailed thanks
@engineeringjoe
@engineeringjoe 8 лет назад
+Sam Host why ?
@searchbarwebs
@searchbarwebs 8 лет назад
security.stackexchange.com/questions/32852/risks-of-a-php-image-upload-form
@kluftdeko8513
@kluftdeko8513 7 лет назад
I think its not vulnerable for double extension because he is splitting the filename into a array. He is using as split the "." and he will get a array. If u take "name.php.txt" you will get a array with "name|php|txt". He is taking the last element of the array for the extension wich will be correct in this case. I cant think about a case where this wont work.
@TRchotbal
@TRchotbal 7 лет назад
Oh no no no noo. The tutorial is pretty good, but checking the ext can pretty much f the whole system up. I recommend checking the MIME type instead (and google to find more security uploadings with php as well). If not then anyone can change uploading file types i.e. myPdf.pdf to myPdf.jpg and wolaaa, it gets uploaded. Also I recommend using the uniqid(mt_rand(), true). Otherwise a good and helpful tutorial.
@sjarreldevis6406
@sjarreldevis6406 8 лет назад
Awesome tutorial! What if i want to upload PDF files? Thanks!
@aseemlalfakawma5084
@aseemlalfakawma5084 7 лет назад
you add 'pdf' to the $allowed array.
@EloyFernandes91
@EloyFernandes91 10 лет назад
If you upload a jpg file, how can you show it like if you upload a facebook photo?
@EddieNotFound1
@EddieNotFound1 10 лет назад
Just print out the location of the file inside an HTML img tag, you still need to wait for the file to be uploaded in order to do this, or you can also use AJAX for make it look better. You can archieve this in the client using any HTML5 feature too but that could a bit more advanced.
@kaunas163
@kaunas163 8 лет назад
excellent tutorial, keep the good work!
@dharakhorasiya4704
@dharakhorasiya4704 6 лет назад
Excellent tutorial
@AzizjanAyupov_leo
@AzizjanAyupov_leo 9 лет назад
Please hepl me! I need to write video uploader script. How I can do it?
@RomeWithTheHEMIs
@RomeWithTheHEMIs 9 лет назад
+Azizjan Ayupov This is what you need for uploading videos. Perhaps, you're talking about streaming them. Look for a tutorial on that, if so.
@AzizjanAyupov_leo
@AzizjanAyupov_leo 9 лет назад
Jerome Carter thank you, friend! I already had done it)
@KushalLuitel
@KushalLuitel 9 лет назад
i tried it for mp3 nothing happened. please help me out
@johnreeves2435
@johnreeves2435 8 лет назад
+Kushal Luitel a bit late of a reply, but did you ever figure out how to upload mp3s?
@johnreeves2435
@johnreeves2435 8 лет назад
+John Reeves I'm replying to myself here, but the issue ended up being that the maximum upload size was limited to 2MB by my php.ini file. I raised it, and then my mp3s went through to the uploads folder. Make sure you restart apache/your server so that the changes to php.ini take effect.
@KushalLuitel
@KushalLuitel 8 лет назад
+John Reeves thanks I'll try it
@benttoenail
@benttoenail 9 лет назад
Beautiful - thanks for the info
@gouripattar403
@gouripattar403 6 лет назад
But it is showing undefined index : tmp_name
@andrehideki859
@andrehideki859 6 лет назад
Thank you. This video was very useful.
@lulu-xd3lg
@lulu-xd3lg 7 лет назад
nice and concise
@anirbanchakraborty690
@anirbanchakraborty690 8 лет назад
awesome video, very informative .
@kayoutube690
@kayoutube690 8 лет назад
Hi Sir Alex, could you please do sample tutorial in php, like login authentication if the user fail to login 3 times the users were going to ban.thank you .
@Hoogleyboogleynetwork
@Hoogleyboogleynetwork 7 лет назад
This is fairly easy to do, I'm assuming you know how to use the PHP insert and mysql_query feature. How I do this is I make a database table called "login attempts" to store every login attempt. You can do PHP to select data from there and compare them using mysql_num_rows and see if there are 3 for a specific user. Sorry if this was confusing.
@japjap6406
@japjap6406 8 лет назад
how it will save in the xampp
@DoorsExciteMe
@DoorsExciteMe 9 лет назад
Fantastic, thanks!
@EldanShkolnikov
@EldanShkolnikov 9 лет назад
Great Tutorial. Thank you!
@MrLinusunil
@MrLinusunil 7 лет назад
Worked, thanks!
@francispauloguillermo9241
@francispauloguillermo9241 7 лет назад
Thank you it helped me a lot
@aviC137
@aviC137 7 лет назад
Thank you!
@ALIMUNTH
@ALIMUNTH 10 лет назад
SAME ALEX from 2 years a go :)
@ArnoldsKtm
@ArnoldsKtm 10 лет назад
Oh really?
@TheGauravmankar
@TheGauravmankar 10 лет назад
You are awesome
@andyjohn907
@andyjohn907 4 года назад
thanks it worked for me..
@hassankhalid2520
@hassankhalid2520 8 лет назад
Great Demonstration (Y)
@sanchitapaul2823
@sanchitapaul2823 6 лет назад
it will be helpful if you add source code link :)
@hiaQadeer
@hiaQadeer 7 лет назад
Thank you, it was interesting.
@wazihsabir8740
@wazihsabir8740 8 лет назад
Thank you so much dude!! You are so fucking smart!
@gregs6178
@gregs6178 8 лет назад
Everything works except moving the file to the server's directory!!!
@danielsomoghi7493
@danielsomoghi7493 8 лет назад
that might be because you do not have read & write permission for that folder. Assuming you are testing all this out in your local machine using XAMPP or WAMPP, (on windows) you can select the folder you are trying to move the file to, right click it, go to the Security tab and enable permissions for all users. (on Mac) right click on the desired folder, Get info, select everyone at the bottom, double click on "everyone" and select "Read & Write". I reckon on a domain all the privileges are set by default to read and write but I might be wrong. Hope this helped :) cheers
@gregs6178
@gregs6178 8 лет назад
that was the problem. I'm using apache web server via ubuntu. I changed the directory permissions and was able to post.
@UrbanKhalifah
@UrbanKhalifah 10 лет назад
very informative, thank you =]
@codecourse
@codecourse 10 лет назад
Great :)
@ǿǿřǿ-j6z
@ǿǿřǿ-j6z 5 лет назад
thanq
@aramsadoyan5233
@aramsadoyan5233 9 лет назад
heeeeeeeeeeY!!!!!!1 where are your - choose file button in source??? ...ilusianist
@Trambulhao
@Trambulhao 10 лет назад
Alternative: $ext = pathinfo($file_name, PATHINFO_EXTENSION);
@ShubhamSrivastava24
@ShubhamSrivastava24 10 лет назад
Thanks :)
@websiteprogrammer7307
@websiteprogrammer7307 7 лет назад
Checkout how to upload a specific type of file from my html document
@ImpulseYou
@ImpulseYou 7 лет назад
thx !
@wickedsnuk3812
@wickedsnuk3812 6 лет назад
I would marry you if I was a woman. Thank you so fckng much !! you are nuts !
@Jattonroax
@Jattonroax 6 лет назад
what the fuck is tmp_name
@giangphan9291
@giangphan9291 9 лет назад
thank you :v
@aliaalea117
@aliaalea117 7 лет назад
ah ribet banget, ane jga bisa ayo berteman Fb facebook.com/caberawit78
@bryallen11
@bryallen11 7 лет назад
Nice voice and accent! Not a tutorial for beginners. Way too much mumbo jumbo for people who want to learn a basic file upload in php. Overall, bad! The essence of teaching something is starting from the premise that the people who are learning from you have no idea what they're doing. It takes a skilled educator to move slowly through and explain in a deliberate manner as if talking to a child because that's where learners are at, they are at a childlike state. What would have been constructive is to start from basic file upload and then in subsequent tutorials to add things like file ext and size checking.
@kluftdeko8513
@kluftdeko8513 7 лет назад
I think it is the easiest way he can tell us as spectators how a file transfer script is working. Iam a beginner in php too and i could understand it easily.
Далее
PHP Multiple File Uploading
22:48
Просмотров 73 тыс.
The Future of Brawl Stars in 2025!
04:27
Просмотров 2,3 млн
КЛИП ЛИСА УЖЕ ВЫШЕЛ!
00:16
Просмотров 422 тыс.
Lecture 1: Course Overview + The Shell (2020)
48:17
Просмотров 751 тыс.
Writing Code That Runs FAST on a GPU
15:32
Просмотров 562 тыс.
PHP Security: Understanding SQL Injection
12:00
Просмотров 56 тыс.
Download and Upload files using HTML & PHP
6:37
Просмотров 116 тыс.
move_uploaded_file not uploading PHP
10:54
Просмотров 10 тыс.
TCP/IP for Programmers
3:03:31
Просмотров 185 тыс.
КАК УСТРОЕН TCP/IP?
31:32
Просмотров 176 тыс.
The Future of Brawl Stars in 2025!
04:27
Просмотров 2,3 млн