CodeIgniter 4 RESTapi Server - Part 4 - Image File Upload

แชร์
ฝัง
  • เผยแพร่เมื่อ 2 ธ.ค. 2024

ความคิดเห็น • 23

  • @bg_napit
    @bg_napit 4 หลายเดือนก่อน

    keep it up bro

  • @carloscituc7951
    @carloscituc7951 3 ปีที่แล้ว

    Thanks a lot Alex, these RESTapi videos were very helpful

  • @jeffersonpimentel2139
    @jeffersonpimentel2139 2 ปีที่แล้ว

    I`m having trouble in fixing some parts in the tutorial because of the new updates so glad it still work out. Thank you for the tutorial by the way!

  • @Virtual__Tours
    @Virtual__Tours 4 ปีที่แล้ว +1

    Hey Alex, i got this error, on both the localhost and server.
    "title": "ErrorException",
    "type": "ErrorException",
    "code": 500,
    "message": "move_uploaded_file(localhost/progis/public/test/1600694149560.jpg): failed to open stream: HTTP wrapper does not support writeable connections",
    "file": "D:\\xampp\\htdocs\\progis\\app\\Controllers\\Client.php",
    "line": 163,
    Please help me with this.

  • @ngikngokgaming5780
    @ngikngokgaming5780 3 ปีที่แล้ว

    Hi alex, i was follow your tutorial but my code can't input on db

  • @darnojiam6268
    @darnojiam6268 ปีที่แล้ว

    Great. Now, how to create RESTapi for downloading a file?

  • @tanyouka_
    @tanyouka_ 3 ปีที่แล้ว

    how can i check if the files is already uploaded on assets folder ?

  • @suprimeqtr242
    @suprimeqtr242 3 ปีที่แล้ว

    i loved this tutorial but i dont know how to use oauth2 for logged in with google account or github account :) i would be thankfull if you made a vedio of that :)

  • @qeposoalbackend
    @qeposoalbackend 4 ปีที่แล้ว

    Your video really helpful bro, thankkss! :D

  • @vivecaotabil8245
    @vivecaotabil8245 4 ปีที่แล้ว

    first of all i want to say thank you for this tutorial. however i have a question . so by this approach you have , if i want to save data into different tables at once , how do i implement this? do i load all the models in one function? example the register - if i have email password yada yada in one table , and then profile details like photos , city , about me all in another table. with the way your model is , how do i implement this? in codeigniter 3 , i will just create another function in the user model for that , but with yours i dont know how to. please advice

    • @kelvin513
      @kelvin513 3 ปีที่แล้ว +1

      I am thinking you can create another model for the other table. e.g.
      UserModel.php => Table 'users', Fields 'email password yada yaga'
      UserDetailsModel.php => Table 'users_details', Fields 'email profile photo city about_me'
      The 'email' field in 'users' table being a foreign key to 'email' field in 'users_details' table.
      Then in your controllers, you can just load the 'UserDetailsModel' and use it as you would with the 'UserModel'.

  • @Jem59955
    @Jem59955 4 ปีที่แล้ว

    I will appreciate a tutorial to host this app in a domain. Seems that the composer creates a different folder structure than the one I knew.

    • @AlexLancer
      @AlexLancer  4 ปีที่แล้ว +1

      Hey, Ale, check this video: th-cam.com/video/k943H5OiIdE/w-d-xo.html

    • @Jem59955
      @Jem59955 4 ปีที่แล้ว

      @@AlexLancerWatching it! Thanks

  • @sundayamizo
    @sundayamizo 4 ปีที่แล้ว +2

    Hi Alex, Nice tutorial. Can you create the frontend of this tutorial using React? That would be nice. Thanks

  • @linkparasitelink3863
    @linkparasitelink3863 4 ปีที่แล้ว

    Very nice tuto Alex!
    I've tried to do the same with multiple image files but it doesn't work.
    According to the documentation, $this->validate should do the job for single and multiple files. It still show the following error message " file is not valid :(
    Take care of you

    • @AlexLancer
      @AlexLancer  4 ปีที่แล้ว

      Link, will have to test. Thanks for sharing!

    • @kelvin513
      @kelvin513 3 ปีที่แล้ว

      The CI4 validation method just won't works when sending a PUT with multipart/form-data(the image file) request. I think it is not the fault of CI4 but because PHP won't capture those form data and upload file correctly in the $_REQUEST and $_FILES variables.

  • @muhammadyudha7708
    @muhammadyudha7708 4 ปีที่แล้ว

    is it possible on codeigniter 3 ?

    • @kelvin513
      @kelvin513 3 ปีที่แล้ว

      Yes. I have done the exact same thing on CI3. The overall flow are similar.

  • @kelvin513
    @kelvin513 3 ปีที่แล้ว

    Thanks Alex for this great video.
    It doesn’t make sense to me to send a update request using a POST request.
    After reading the documentation and some google, I have concluded that it’s not possible to have a PUT request sent with a file.
    I am thinking to make the file upload another endpoint, and keep the form data separated.

  • @riedayme6471
    @riedayme6471 4 ปีที่แล้ว

    greattt