Skip to content

I cannot create a file with writeContents #189

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
uguraltinsoy opened this issue Aug 1, 2024 · 1 comment
Open

I cannot create a file with writeContents #189

uguraltinsoy opened this issue Aug 1, 2024 · 1 comment

Comments

@uguraltinsoy
Copy link

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.
@Realzzz1874
Copy link

I got the same, is there any solutions...plz?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants