PHP File Upload | How to Upload Files and Images with PHP | PHP Tutorial | Learn PHP Programming

Поделиться
HTML-код
  • Опубликовано: 6 авг 2024
  • Upgrade your Clever Techie learning experience:
    / clevertechie
    UPDATE! (9/13/19) New features and improvements for Clever Techie Patreons:
    1. Download full source code with detailed comments - easy to learn and understand code
    2. Weekly source code file updates by Clever Techie - every time I learn new things about a topic I will add it to the source file and let you know about the update - keep up with the latest coding technologies
    3. Library of custom Clever Techie functions with descriptive, easy to understand comments - skyrocket coding productivity, code more efficiently by using Clever library of custom re-usable functions
    4. Syntax code summary - memorize and review previously learned code faster
    4. Organized file structure - access all Clever Techie lessons, source code, graphics, diagrams and cheat sheet from a single workspace - no more searching around for previously covered material and source code - save enormous amount of time and effort
    5. Outline of topics the source file covers - fast review of all previously learned coding lessons
    6. Access to all full HD 1080p videos with no ads
    7. Console input examples - interactive examples that make it easier to understand and learn coding
    8. Access to updated PHP Programming Book by Clever Techie
    9. Early access to Clever Techie videos
    Subscribe to Clever Techie patreon:
    / clevertechie
    ````````````````````````````````````````````````````````````````````````````````````````````` Upload Files and Images to Website in PHP | PHP Tutorial | Learn PHP Programming | Image Upload
    In this video we're going to learn how to upload files with php. We'll use an HTML form with enctype="multipart-form-data" and a file upload input field to let the user select a file from their computer and submit it to the server. We will then capture the data with PHP code by accessing $_FILES array where the information about the submitted file is stored. We'll do error checking and then finally use the move_uploaded_file() function to move the file from a temporary directory to a destination of our choice.
    `````````````````````````````````````````````````````````````````````````````````````````````
    Hey guys, I'm now using Patreon to share improved and updated video content and source files. For a small fee you can access all the downloadable files from this lesson (source code, icons & graphics, cheat sheets, OneNote notes) and everything else included in the video from the Patreon page. Additionally, you will get access to ALL Clever Techie videos in HD format with no ads. Thank you so much for supporting Clever Techie :)
    Download this video's files here:
    / php-file-image-20897015
    ( You also get access to ALL source code and any downloadable content of ALL Clever Techie videos, as well as access to ALL videos in HD 1080p quality format with all video ads removed! )
    `````````````````````````````````````````````````````````````````````````````````````````````
    ( Website ) clevertechie.com - PHP, JavaScript, Wordpress, CSS, and HTML tutorials in video and text format with cool looking graphics and diagrams.
    ( RUclips Channel ) / clevertechietube
    ( Google Plus ) goo.gl/J71p6f - clever techie video tutorials.
    ( Facebook ) / clevertechie
    ( Twitter ) / theclevertechie
  • ХоббиХобби

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

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

    Great tutorial! Thank you and looking forward for more!

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

    Very nice structured!

  • @kirbylegaspi984
    @kirbylegaspi984 4 года назад +1

    this save my life. thanks

  • @maleficgunner5245
    @maleficgunner5245 5 лет назад +6

    I love your tutorials! You speak calmly, clear and in very understandable terms for beginners, if you might be an IT Prof I bet student's would have a better perspective onto coding. Keep up the awesomeness!

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

      I realize Im pretty off topic but do anyone know of a good website to watch newly released series online?

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

      @Wells Houston flixportal =)

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

      @Kolton Major Thanks, I went there and it seems to work =) Appreciate it !!

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

      @Wells Houston you are welcome :D

  • @ramshayaseen8429
    @ramshayaseen8429 5 лет назад +2

    what if i upload the picture, and then it has to be shown up after it's been uploaded? like facebook, when we upload the picture then after posting it's shown up! please help because i want something like that.

  • @programmingisanotherworld3989
    @programmingisanotherworld3989 4 года назад

    Thank you sir .

  • @halaabjar7665
    @halaabjar7665 4 года назад

    The best video

  • @wisdomguy9837
    @wisdomguy9837 4 года назад

    Hi there how could I skip the error to continue to save into my database without selecting a file to upload and leaving it blank?

  • @johnmillstead8396
    @johnmillstead8396 6 лет назад +1

    I love your training and the use of OneNote for organization. Maybe you can turn off the "tool tips" so they don't keep popping up? Thanks!

    • @clevertechie
      @clevertechie  6 лет назад

      Yeah those tool tips are annoying, will have them turned off next time!

  • @VFRodriguez
    @VFRodriguez 4 года назад

    Good course. Can you explain how i would upload an image with a different name. Say the file to upload is in c:\images\john.jpg and I need to upload it with the name 1_john.jpg? In other words, with prefix 1_ and the name

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

    Can you upload very large files like videos? Also can you upload from a mobile phone to a website using this code?

  • @codemon_
    @codemon_ 6 лет назад +3

    i have been waiting for this.. a vey recent video and i am on time. please make a video on multiple files upload

    • @clevertechie
      @clevertechie  6 лет назад +1

      Yes, I was thinking about multiple files upload video as well, thanks for your suggestion!

    • @codemon_
      @codemon_ 6 лет назад +1

      thanks...would be expecting!! Biggest fan

    • @Wesley-xl5vv
      @Wesley-xl5vv 6 лет назад

      Plugin called dropzone is awesome for that

  • @ISOnepal
    @ISOnepal 4 года назад

    Can we do same regarding video ?

  • @cfpwastaken
    @cfpwastaken 5 лет назад +1

    [error] => 1
    why?

  • @stephanierouby649
    @stephanierouby649 5 лет назад

    There is a problem with unauthorized extensions: we can download a file with another extension, as can be seen in your video: wima6490.exe has been downloaded ... a possible fix?

    • @harabisj
      @harabisj 5 лет назад

      Probably denying access to files with certain extensions in .htaccess?

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

    why not just make the code freely available? makes it harder unnecessarily

  • @Alex_Eicher
    @Alex_Eicher 6 лет назад

    Bear, Duck, Fox!

  • @martingitau2097
    @martingitau2097 6 лет назад

    thanks for the video

  • @hasangaffar2716
    @hasangaffar2716 6 лет назад

    Please make complete php training and laravel

    • @clevertechie
      @clevertechie  6 лет назад +1

      What do you mean complete php training? I already have videos that cover most of php. I'll look into laravel, thanks!

  • @ikidtech
    @ikidtech 5 лет назад +1

    is there a way to allow users to download the files?

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

      Directly acsessing the file url (e.g yoursite.com/images/wow.png) will download the file

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

      @@SlashedSucks lol 2 years later but I got it

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

      @@ikidtech i just responded for the memes 😂

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

    fox was before uploading.....

  • @Someone-ex5ed
    @Someone-ex5ed 5 лет назад +3

    Does it really need 27 min to learn how to upload file with PHP?

  • @stefanbogdanovic590
    @stefanbogdanovic590 6 лет назад

    Nice video are you russian? Cheers from Serbia 😁

    • @clevertechie
      @clevertechie  6 лет назад

      Thanks brother, yes I'm from Siberia :) I live in the states though.

    • @stefanbogdanovic590
      @stefanbogdanovic590 6 лет назад

      @@clevertechie Nevee would guess it you have awesome accent for Russian, will you record Laravel in near future, I've learned a lot from your videos 😁

    • @clevertechie
      @clevertechie  6 лет назад +1

      I might, people keep asking about it, I'd have to learn it myself first though

  • @faheemahmad3957
    @faheemahmad3957 4 года назад

    why he used . and copied same code again at 12:00 +_... please help

  • @vadwebdev9009
    @vadwebdev9009 5 лет назад

    Upload to db code missing, so you get a dislike from me.