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

Upload a file to track #2

Open
jacks8x opened this issue Apr 14, 2014 · 3 comments
Open

Upload a file to track #2

jacks8x opened this issue Apr 14, 2014 · 3 comments

Comments

@jacks8x
Copy link

jacks8x commented Apr 14, 2014

Hi, how can I upload my mp3 in local file to your server and then get info about this sample in iOS. With your api I can use to send a link then analysis it, but I don't know how to upload a file, I see there is no API to do this (I see this api in Java, but not iOS)

@plamere
Copy link
Member

plamere commented Apr 14, 2014

jacks8x - enios should support track upload directly, but I haven't personally tried it. Take a look at

  • (ENAPIRequest *)POSTWithEndpoint:(NSString *)endpoint
    andParameters:(NSDictionary *)parameters
    andCompletionBlock:(ENAPIRequestCompletionBlock)completionBlock

add a parameter 'track' that is of type NSData that contains the mp3. You'll probably also need to set a filetype parameter to @"mp3" as well.

You may be the first to head down this road, so if you have trouble let me know. I have some code for uploading a track to the Echo Nest for analysis that I know works (however, it doesn't use ENIOS). You can use it in a pinch if you have trouble with the ENIOS code. The upload code is here:

https://gist.github.com/plamere/10638004

@jacks8x
Copy link
Author

jacks8x commented Apr 15, 2014

Hello, I use ENAPIRequest POSTWithEndpoint for analysis a file in a url and it works great. But when I want to upload file from Bundle to test I have no idea how to use your api to add mp3 data to the body for request. In your upload code link I have confused what is Track

@plamere
Copy link
Member

plamere commented Apr 15, 2014

The code that I posted does not use ENIOS, it is from a personal project. The Track in that code is my own track class.

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