I could not find the answer to my question anywhere, so I decided that I asked.
I use Alamofire 3.1.5 to download a fairly large volume of images, we are talking in hundreds of MB.
There is a code snippet:
self.manager.upload(.POST, url, headers: headers, multipartFormData: { multipartFormData in multipartFormData.appendBodyPart(fileURL: generalURL, name: "general", fileName: "general", mimeType: "image/jpeg") multipartFormData.appendBodyPart(fileURL: img1URL, name: "img1", fileName: "img1", mimeType: "image/jpeg") multipartFormData.appendBodyPart(fileURL: img2URL, name: "img2", fileName: "img2", mimeType: "image/jpeg") multipartFormData.appendBodyPart(fileURL: img3URL, name: "img3", fileName: "img3", mimeType: "image/jpeg") }, encodingCompletion: { encodingResult in . . .
As I understand it, Alamofire processes this request, saving them to disk, for better optimization of RAM. This is reasonable, and I am very happy about it. It just works flawlessly.
On the other hand, this means that basically doubles the payload of data on the disk.

The fact is that these a files are not deleted, and even calls up the default iOS screen, warning that the device is working in free space.
I know how to delete the contents of this directory, but in my current code stream itβs safe to delete the contents after the completion of the entire request, it can even be 100 requests, and each of them takes about 20 MB of payload, so the fact is that the device can even not be able to store this amount of data.
My question is:
Can I force Alamofire to delete each of these files after it has successfully downloaded?
Sorry for the rather long question, I would post you potatoes, but this is not 9gag.