Upload image with parameters in Swift

后端 未结 3 1051
[愿得一人]
[愿得一人] 2020-11-22 04:14

I\'m trying to upload an image with parameters in Swift. When I try this code, I can get the parameters but not the image

uploadFileToUrl(fotiño:UIImage){
           


        
3条回答
  •  孤街浪徒
    2020-11-22 04:59

    Thank you @Rob, your code is working fine, but in my case, I am retriving image from gallary and taking name of the image by using code:

    let filename = url.lastPathComponent
    

    But this code, displaying image extension as .JPG (in capital letter), but server not accepting extensions in captital letter, so i changed my code as:

     let filename =  (path.lastPathComponent as NSString).lowercaseString
    

    and now my code is working fine.

    Thank you :)

提交回复
热议问题