On Tue, Nov 17, 2009 at 6:30 AM, squared99 <squa...@gmail.com> wrote:
> Where I am having a bit of trouble is in understanding the process
> flow for a file upload.
> Is it possible to upload via the browser directly to the users
> soundcloud account from the web application, similar to the way that
> the youtube browser uploading works?
> http://code.google.com/apis/youtube/2.0/developers_guide_protocol.html#Browser_based_uploading,
>
> ie I dont have to get them to upload a file to us first, but can
> simply build a form that allows them to upload directly to their
> soundcloud account and redirects back to the web app with status
> information on the upload.
>
Yes, you can upload directly to our host, but not completely without risk.
We support plain vanilla OAuth 1.0(a) and use multipart/form-data
mimetype encoding for receiving files. The OAuth specification says
that multipart/form-data POST requests should include any request body
parameters when generating the request signature
(http://oauth.net/core/1.0a#anchor13). This allows for "pre-signed"
file upload requests. You simple create a mock POST request to the
/tracks resource and extract the oauth parameters and use them to
populate the form fields.
Though this must be done with precaution. The oauth parameters in the
form could be extracted for malicious purposes.
> Or am i going to have to get the file uploaded to our server first and
> then bounce it over to their soundcloud account?
This would be the more secure approach.
> Any insights appreciated. I'm working in PHP btw.
Are you using http://github.com/mptre/php-soundcloud or do you hack
your custom solution?
Cheers,
Hannes
--
Hannes Tydén
Developer, SoundCloud
Mail: han...@soundcloud.com
Skype: hannestyden
Phone: +49 157 7471 6101
Rosenthalerstr. 13
10119 Berlin, DE
What is SoundCloud?
http://soundcloud.com/tour