Pick image from gallery and upload to server iOS - SwiftUI and PHP

Sdílet
Vložit
  • čas přidán 26. 08. 2024
  • Pick an image from the gallery and upload to server iOS - SwiftUI and PHP
    Get ImagePicker from here:
    adnan-tech.com...

Komentáře • 17

  • @edutyl9372
    @edutyl9372 Před rokem

    Hey, great video! Do you know how to get the selected image filetype? or is every decoded image a jpeg?

  • @erickgalindo2941
    @erickgalindo2941 Před 2 lety

    Hi, thank you so much for the video. I need to add some extra data to the image, like an url-.. How can I do that?

    • @AdnanAfzal565
      @AdnanAfzal565  Před 2 lety

      You can simply append it in the data URL, that is string.

  • @NikolaPrljeta
    @NikolaPrljeta Před 3 lety

    i need to do the exact same but send the authorization in the header, and the image data in the body of the request, instead. I'm using Swift 5, but the networking should be the same. Any modifications of the above necessary concerning the request setup?

    • @AdnanAfzal565
      @AdnanAfzal565  Před 3 lety

      For that, you might need to use a library called Alamofire. It will be different from this tutorial.

  • @natgenesis5038
    @natgenesis5038 Před 2 lety

    can you do how to upload video from photos in SwiftUI ???

  • @valeriiachernova69
    @valeriiachernova69 Před 2 lety

    Hello,thank you for the video
    But how to do if i want to upload more than 1 photo to the server?
    In your tutorial you can upload only 1 photo
    And if i choose "Upload the photo" the next photo replace the previous one
    Thank you

    • @AdnanAfzal565
      @AdnanAfzal565  Před 2 lety

      For multiple images, you need to use the following library:
      github.com/B-Sides/ELCImagePickerController

    • @valeriiachernova69
      @valeriiachernova69 Před 2 lety

      @@AdnanAfzal565 And what about PHP?
      I need to rewrite the whole script

    • @AdnanAfzal565
      @AdnanAfzal565  Před 2 lety

      @@valeriiachernova69 No. You need to send an array of base64 string from iOS to PHP. And then on PHP side, you can loop through all (like the following):
      foreach ($_POST["images"] as $image)
      {
      // base64 decode code goes here
      }

    • @valeriiachernova69
      @valeriiachernova69 Před 2 lety

      @@AdnanAfzal565 like this?

    • @AdnanAfzal565
      @AdnanAfzal565  Před 2 lety

      @@valeriiachernova69 We created a separate tutorial for multiple images upload from iOS to PHP. You can follow this: adnan-tech.com/how-to-upload-single-and-multiple-images-in-ios-swift-php-and-mysql/

  • @frisdiandiseptiatama6098

    I want to ask, How about upload image with mutlripart in swift ui