How to execute alamofire background upload request?
from Background Transfer Considerations
:
Only upload tasks from a file are supported (uploading from data objects or a stream will fail after the program exits).
that means it is limitation from NSURLSession - you need you upload from a file and then try to solve the other error with file
Update
appDeligate.log.debug("request was sended")
let tempZipFilePath = UtilDirectory.tempZipPath.tweak()
alamoFireManager.upload(tempZipFilePath,
to: deligate.url,
method: .post,
headers: headers)
Access encodingResult when uploading with Alamofire 5
Multipart encoding is fully integrated into the now-asynchronous request pipeline in Alamofire 5. That means there's no separate step to use. However, you can use the MultipartFormData
type directly, just like you would in the request closure.
let data = MultipartFormData()
data.append(Data(), withName: "dataName")
try data.encode()
Related Topics
I Have Trouble Using Cornerradius and Borders on a Textfield in Swiftui
Pod Install Gpuimage Does Not Work
Encoding Swift String as Escaped Unicode
Swift Error Using Initialized Properties in Expressions Before Super.Init
Swiftui: Localizedstringkey with Indices
Writing Data to an Outputstream with Swift 5+
Swift Subclasses Used in Generics Don't Get Called When Inheriting from Nsobject
Drag a Cgrect Using Uipangesturerecognizer
Skscene Becomes Unresponsive While Being Idle
Programmatically Scroll Nsscrollview to the Right
Swift Generics Error: Cannot Convert Value of Type 'Type<T>' to Expected Argument Type 'Type<_>'
Swiftui - How to Change Text Alignment of Label in Toggle
How to Connect Outlets and Actions in Swift/Macos Programaticly
How to Open a Url in Safari Even If My Default Browser Is Not Safari Using Swift in MACos
Trouble with Non-Escaping Closures in Swift 3
How to Delete Object in Array of Dictionaries Using Key Value