Skip to content
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

Cannot upload file #294

Open
LinusGeffarth opened this issue Jun 12, 2018 · 0 comments
Open

Cannot upload file #294

LinusGeffarth opened this issue Jun 12, 2018 · 0 comments

Comments

@LinusGeffarth
Copy link

LinusGeffarth commented Jun 12, 2018

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?

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

1 participant