Why Upload Alamofire Background Request Don't Executes in Background

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



Leave a reply



Submit