Quantcast
Channel: The Echo Nest Developer Forum
Viewing all articles
Browse latest Browse all 1582

failure with local file upload

$
0
0

Hey, I have been having trouble with local file uploads in C#. My method is a POST request:

form.AddField("Content-Type","application/octet-stream");
form.AddField("api_key",mykey);
form.AddField("filetype","ogg");
form.AddField("url","/Users/myuserspace/Desktop/Oggs/music.ogg");
form.AddField("track",music.ogg);
form.AddBinaryData("--data-binary", @track);

But this gives an error: {"response": {"status": {"version": "4.2", "code": 5, "message": "method - Invalid parameter: "Content-Type""}}} All the info I've found suggests that this is valid. What am I doing wrong? In addition, I tried:

form.AddField("api_key",mykey);
form.AddField("filetype","ogg");
form.AddField("url","/Users/myuserspace/Desktop/Oggs/music.ogg");

I think the format for the local url is wrong, since this gives a 500 error. When I use a random file on the internet, it does work. I've never seen any c# examples, so I'm a little stuck.


Viewing all articles
Browse latest Browse all 1582

Trending Articles