Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/vishalkalola1/multipart-image-upload-ios-demo
Upload image using multipart in swift
https://github.com/vishalkalola1/multipart-image-upload-ios-demo
image imageupload ios multipart-uploads objective-c swift swift4
Last synced: 6 days ago
JSON representation
Upload image using multipart in swift
- Host: GitHub
- URL: https://github.com/vishalkalola1/multipart-image-upload-ios-demo
- Owner: vishalkalola1
- License: mit
- Created: 2018-06-16T14:47:57.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2018-07-02T11:48:22.000Z (over 6 years ago)
- Last Synced: 2024-10-29T18:23:55.145Z (17 days ago)
- Topics: image, imageupload, ios, multipart-uploads, objective-c, swift, swift4
- Language: Swift
- Homepage:
- Size: 49.8 KB
- Stars: 8
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# multipart-Image-Upload-ios-demo
## PODS
```
pod 'multipart-Image-Upload-ios-demo'
```
- If you use above Parameters and URL this is the demo/ Debug URL for library. so in init mwthod i have passed the debug as true.
- In you URL and parameter you need to pass debug As a false.
- You can upload only three type of image like JPEG, PNG and GIF```
//************************* Testing code ************************************
let url = "https://api.imgur.com/3/image"
let parameters = ["name": "MyTest",
"description": "My tutorial test"]
//***************************************************************************************let objmultipart = VMultipartImage.init(url, paramters: parameters, image: #imageLiteral(resourceName: "testImage"), imagekey: "image", imageName: "abc.jpeg",MimeType: .jpeg,Debug: true)
let session = URLSession.shared
session.dataTask(with: objmultipart.request) { (data, response, error) in
if let response = response {
print(response)
}
if let data = data {
do {
let json = try JSONSerialization.jsonObject(with: data, options: [])
print(json)
} catch {
print(error)
}
}
}.resume()
```