FileProvider
FileProvider copied to clipboard
I cannot create a file with writeContents
func creatingFile(_ name:String, _ mime_type:String = "txt", completion: @escaping () -> Void) {
guard let documentsProvider = WebDAVFileProvider(baseURL: URL(string: server.host)!, credential: credential) else { return }
let filePath = "\(path)/\(name).\(mime_type)"
documentsProvider.writeContents(path: filePath, contents: nil, atomically: true, overwrite: false, completionHandler: { error in
guard error == nil else { return }
completion()
})
}
I get the following error in the console and completionHandler does not work at all, I do not get an error message
The request of a upload task should not contain a body or a body stream, use `upload(for:fromFile:)`, `upload(for:from:)`, or supply the body stream through the `urlSession(_:needNewBodyStreamForTask:)` delegate method.