[GH-ISSUE #313] Help needed with Multipart upload #190

Closed
opened 2026-03-03 16:46:33 +03:00 by kerem · 2 comments
Owner

Originally created by @antwerpenR on GitHub (Nov 14, 2016).
Original GitHub issue: https://github.com/OAuthSwift/OAuthSwift/issues/313

I have been using OAuthSwift for some time successfully to read data from meetup.com. I can also do some simple .POST (eg comments upload).....but I am stuck on how to do Photo Upload.

Can you show some sample code for the MultiPart upload and/or give any tips/suggestion for how to use OAuthSwift for this endpoint: https://www.meetup.com/meetup_api/docs/2/member_photo/#create

OAuth Provider (Twitter, Github, ..): meetup.com

OAuth Version:

  • [ XX] Version 2

OS (Please fill the version) :

  • iOS :

Installation method:

  • [X ] CocoaPods

Library version:

  • [X ] head

Xcode version:

  • [X ] 8.0 (Swift 3.0)
Originally created by @antwerpenR on GitHub (Nov 14, 2016). Original GitHub issue: https://github.com/OAuthSwift/OAuthSwift/issues/313 I have been using OAuthSwift for some time successfully to read data from meetup.com. I can also do some simple .POST (eg comments upload).....but I am stuck on how to do Photo Upload. Can you show some sample code for the MultiPart upload and/or give any tips/suggestion for how to use OAuthSwift for this endpoint: https://www.meetup.com/meetup_api/docs/2/member_photo/#create ### OAuth Provider (Twitter, Github, ..): meetup.com ### OAuth Version: - [ XX] Version 2 ### OS (Please fill the version) : - [x] iOS : ### Installation method: - [X ] CocoaPods ### Library version: - [X ] head ### Xcode version: - [X ] 8.0 (Swift 3.0)
kerem 2026-03-03 16:46:33 +03:00
Author
Owner

@phimage commented on GitHub (Nov 14, 2016):

I am sure how to achieve this, I don't use this functionality.

let fileData = OAuthSwiftMultipartData(name: "photo", data: data, fileName: fileName, mimeType: mimeType)
let multiparts = [fileData]
client.postMultiPartRequest(urlString, method: .post, multiparts: multiparts)

data is `Data' from file
if you can find mime type, put nil

I don't know if you can pass other parameters using parameters dictionary
For other parameters, try to put it in query

<!-- gh-comment-id:260274562 --> @phimage commented on GitHub (Nov 14, 2016): I am sure how to achieve this, I don't use this functionality. ``` swift let fileData = OAuthSwiftMultipartData(name: "photo", data: data, fileName: fileName, mimeType: mimeType) let multiparts = [fileData] client.postMultiPartRequest(urlString, method: .post, multiparts: multiparts) ``` `data` is `Data' from file if you can find mime type, put nil I don't know if you can pass other parameters using `parameters` dictionary For other parameters, try to put it in query
Author
Owner

@antwerpenR commented on GitHub (Nov 14, 2016):

Thanks! That is what I needed. The answer was staring me in the face! The error message that I was getting was that field "photo" was required....but I could not think where to put it and then I realised that this is what the "name" parameter should be. All working fine. Thanks again

<!-- gh-comment-id:260284597 --> @antwerpenR commented on GitHub (Nov 14, 2016): Thanks! That is what I needed. The answer was staring me in the face! The error message that I was getting was that field "photo" was required....but I could not think where to put it and then I realised that this is what the "name" parameter should be. All working fine. Thanks again
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/OAuthSwift#190
No description provided.