'Upload video with large size using Alamofire
Trying to be able to upload large video files using Alamofire where video size can be in GB. I just need to figure out how I can upload the videos of such size to server.
func uploadVideo(videoUrl: URL) { // local video file path..
let timestamp = NSDate().timeIntervalSince1970 // just for some random name.
AF.upload(multipartFormData: { (multipartFormData) in
multipartFormData.append(videoUrl, withName: "image", fileName: "\(timestamp).mp4", mimeType: "\(timestamp)/mp4")
}, to: endPoint! ).responseJSON { (response) in
debugPrint(response)
}
}
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
