PHP File Uploads - Full PHP 8 Tutorial

Поделиться
HTML-код
  • Опубликовано: 30 ноя 2024

Комментарии • 78

  • @Vitalii-m6r
    @Vitalii-m6r Год назад +2

    This is by far the best PHP tutorial! Thanks a million!

  • @spieska
    @spieska 3 года назад +9

    I can't express enough how much I appreciate your course! If you would get yourself a Patreon account or something, I would definitely support you!

  • @ifetmartinovic
    @ifetmartinovic 8 месяцев назад

    I dalje jedan opd najboljih časova PHP-a na koje sam naišao dosad. Svaka čast Gio !

  • @php3418
    @php3418 3 года назад +9

    I know you may not have a lot of time but please upload more as you can .. This series is the only modern one on the internet and many people depend on it for learning php

    • @ProgramWithGio
      @ProgramWithGio  3 года назад +4

      I put out 2 videos per week whenever I can, sometimes 1. That is what I physically am able to record & edit at the moment given the limited free time that I have.

    • @php3418
      @php3418 3 года назад +1

      @@ProgramWithGio
      I appreciate your efforts ❤

    • @user-vh3lm3qo4t
      @user-vh3lm3qo4t 3 года назад +4

      @Program With Gio your work on this channel is a genuine service to the global web development community, thank you

  • @AlirezaSalehi-xz3ch
    @AlirezaSalehi-xz3ch 3 года назад +1

    this channel has very good and useful tutorials the topics that are discussed are definitely practical in action , thanks for making them and Hope you complete his course as complete as u can

  • @asmotovlogs228
    @asmotovlogs228 Год назад

    This series is very very valuable. Thank you so much, Gio

  • @michaelplichart3224
    @michaelplichart3224 2 месяца назад

    Great explanation, great course

  • @madibenallou5562
    @madibenallou5562 Год назад

    Gio you are awesome explaining

  • @Zubbee
    @Zubbee 2 года назад

    This was great. Will come back to it when I start practicing (at the end of section 2). I'll move on. Thanks Gio

  • @mahmudsulemansheikhwunnam3580
    @mahmudsulemansheikhwunnam3580 3 года назад +1

    Good Job! a little suggestion, please. As a PHP developer, I have faced issues dealing with file includes, for example; file B includes file A and when you include file B into file C, there will be a problem with the inclusion of A from the B file. I would be much grateful to see a future video on proper ways of dealing with nested files includes and how to resolve their path.

    • @ProgramWithGio
      @ProgramWithGio  3 года назад +1

      My reply was deleted again by youtube. Not sure if you got my previous reply but basically we covered include/require in first section of the course. You should use namespaces & avoid include/require to avoid issues that you mentioned. Namespaces were covered in the composer lesson so check it out if you missed it.

  • @1NC1S1VOFFICIAL
    @1NC1S1VOFFICIAL 2 года назад

    This series is very valuable. Thank you so much !

  • @federicobau8651
    @federicobau8651 2 года назад

    great video, best php course

  • @lotuslando1994
    @lotuslando1994 9 месяцев назад +2

    I had the issue of not being able to move the file due to a permission error while using Docker.
    I ended up changing the storage folder owner to www-data and that sorted out the problem.
    sudo chown -R www-data:www-data storage
    I put this here for other noobs like me who may be challenged with a similar situation. 🙂

    • @ProgramWithGio
      @ProgramWithGio  9 месяцев назад

      Good job, you could also add the user & group via Docker, you might see that in source code of Expennies project (later section)

  • @SenpaiCodes
    @SenpaiCodes 3 года назад +1

    Awesome tutorial 👌

  • @ilya_123__
    @ilya_123__ 10 месяцев назад

    thank you for your great job!

  • @emekatimothyiloba699
    @emekatimothyiloba699 Год назад

    Thank you Gio

  • @noreddinseflawi6462
    @noreddinseflawi6462 Год назад

    this vidéo is legendary

  • @samuelakinnuoye9938
    @samuelakinnuoye9938 4 месяца назад

    Hello Gio how were you able to use the storage path constant in the Home.php without including or requiring it?

    • @ProgramWithGio
      @ProgramWithGio  4 месяца назад +1

      Storage path is defined in index.php I think & index.php is entrypoint to all requests

  • @wanwan-swagg
    @wanwan-swagg 9 месяцев назад

    How do you set this up on the other php pages so the post code can function properly ->post(/upload , [ App\Classes\Home\::class, 'upload']) I'm confuse on this code I already installed composer to get autoload.php working properly

    • @ProgramWithGio
      @ProgramWithGio  9 месяцев назад

      Maybe you missed some of the previous lessons? Check the routing lesson

  • @bakosyy
    @bakosyy Год назад

    Hey Gio. Did you forget to also mention about `post_max_size` configuration? I read that `post_max_size` should not be less than `upload_max_filesize`.

    • @ProgramWithGio
      @ProgramWithGio  Год назад +1

      post_max_size is the directive for the whole POST body & the file size does contribute to that as well. You would have same issue of reaching that post max size even if u set it at same or slightly bigger than upload_max_filesize when you try to upload multiple files at the same time since their size would go over the max post size. So in general yes you should try & keep post_max_size much higer than upload_max_filesize but it mainly depends on the application & what sort of post requests you will have.

  • @leonardohirsch9086
    @leonardohirsch9086 Год назад

    Hi! Got a question. What about the folder permissions (in a web hosting for example) in order to securly upload files? Do you have any video or article about it? Thanks a lot!

    • @ProgramWithGio
      @ProgramWithGio  Год назад

      Hi, no video specific to that but there is a video about production & deploying the app in third section.

  • @akhileshkumar-iu9uq
    @akhileshkumar-iu9uq 2 года назад

    I am doing ID card project where I have created one 'template'. Using dompdf to create the ID card. But its creating all the ID cards in one pdf document. I would to to generate multiple ID's cards in individual pdf in one click. Please help me on this

    • @ProgramWithGio
      @ProgramWithGio  2 года назад +1

      I haven't worked with dompdf before & can't really help you without more information.

  • @mearjuntripathi
    @mearjuntripathi 9 месяцев назад

    I have using a hosing and my file upload didn't work in my local host it work i changed upload_tmp_dir in .htaccess and php.ini file but nothing happen my file didn't upload and i get error code 6 can you help me please.

    • @ProgramWithGio
      @ProgramWithGio  9 месяцев назад

      I would need to see your code & configuration. Hard to guess the issue this way. Feel free to DM me on X (Twitter)

  • @abdfadee8267
    @abdfadee8267 10 месяцев назад

    Thank you

  • @memack101
    @memack101 2 года назад

    Thank you.

  • @CtrlGame
    @CtrlGame 3 месяца назад

    I have a question, that tmp file storage will ever get cleaned?

    • @ProgramWithGio
      @ProgramWithGio  3 месяца назад +1

      Yes on server restart, the files uploaded however are deleted at the end of the request. From php docs: "The file will be deleted from the temporary directory at the end of the request if it has not been moved away or renamed."
      www.php.net/manual/en/features.file-upload.post-method.php

    • @CtrlGame
      @CtrlGame 3 месяца назад

      @ProgramWithGio great answer, thank you.

  • @tommauro2023
    @tommauro2023 Год назад

    Hi, thanks for the tutorials

    • @ProgramWithGio
      @ProgramWithGio  Год назад +1

      Yes that's correct, if you want to add extension you can add it but you don't have to. You can add extension during download & keep files stored without it.
      About tmp folder it depends what your storage path constant is set to

    • @tommauro2023
      @tommauro2023 Год назад +1

      @@ProgramWithGio Thank you very much!

  • @amijazz1941
    @amijazz1941 11 месяцев назад

    I am learning PHP OOP using Ubuntu Linux, but when uploading, I encounter the error 'move_uploaded_file failed to open stream: Permission denied.'

    • @ProgramWithGio
      @ProgramWithGio  11 месяцев назад

      Check permissions of the directory where you are uploading to

    • @amijazz1941
      @amijazz1941 11 месяцев назад +1

      @@ProgramWithGio Thank you for responding. I granted permissions for creating and deleting files in the folder where I uploaded my file, and it worked. You're an excellent teacher, responding to everyone's comments. Hats off to you!

  • @user-vh3lm3qo4t
    @user-vh3lm3qo4t 3 года назад

    Fantastic tutorial. But I do have one complaint🤔, I am taking a two year web development program in September and you haven't left anything for them to teach me 😢😂🤣

    • @ProgramWithGio
      @ProgramWithGio  3 года назад

      That's amazing haha. Thank you. I'm sure you will learn a lot of things there too 👍

  • @SupremeTec360
    @SupremeTec360 Год назад

    I find myself compelled to look for another video since I can't find the code samples related to this one. It's either me who can't see it or you didn't put it...
    I had to leave a comment cause I see a missed potential on this video... *ciao

    • @ProgramWithGio
      @ProgramWithGio  Год назад

      We work on project later on that has source. This needed no source because it's just a concept. Feel free to write it by hand while watching video, that will help you understand it better 👍

    • @ProgramWithGio
      @ProgramWithGio  Год назад

      @UC0ciKWze0ytRYIQw6gMkbhg where do you see upload.php? It's pointing to /upload route which invokes upload method on Home class. All the code is there, maybe you missed that part?

    • @SupremeTec360
      @SupremeTec360 Год назад

      My bad. I confused:
      action="upload/"
      As something like:
      action="upload.php"
      and thus been looking for an imaginary file whereas it just points to index.php.
      I will take full advantage of this now that I worked that out. I'm working on a production project and was in a bit of a hurry. Otherwise this is a really useful piece of content. I can agree with everyone now...

    • @ProgramWithGio
      @ProgramWithGio  Год назад

      @@SupremeTec360 no worries, glad it worked out at the end, thank you 🙌

  • @syrup8345
    @syrup8345 Год назад

    Hiiii love the tutorial series.
    I got an error about this file upload
    Two warning:
    -Warning: move_uploaded_file(/var/www/public/../storage/Screenshot from 2023-03-04 21-01-09.png): Failed to open stream: Permission denied in /var/www/app/Classes/Home.php on line 27
    -Warning: move_uploaded_file(): Unable to move "/tmp/phpSZ39tl" to "/var/www/public/../storage/Screenshot from 2023-03-04 21-01-09.png" in /var/www/app/Classes/Home.php on line 27

    • @ProgramWithGio
      @ProgramWithGio  Год назад

      Are you using docker? Might have to do with permissions, ping me on Twitter and I can help troubleshoot it