Skip to content

Cannot upload file #294

@LinusGeffarth

Description

@LinusGeffarth

Hey,
I'm trying to upload a file as follows:

guard let imageData = UIImageJPEGRepresentation(image) else { return }
let headers = ["Authorization": Data.accessToken, "Content-Type": "multipart/form-data", "Accept": "application/vnd.api+json"]
let parameters: [String: Any] = [
    "file": Upload(data: imageData, fileName: "img", mimeType: "image/jpeg")
]
HTTP.POST("my-url...", parameters: parameters, headers: headers, completionHandler: completion)

... but the backend doesn't receive the image.

May this be caused by the library? Does it work for anyone else?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions