Skip to content
This repository has been archived by the owner on Oct 10, 2020. It is now read-only.

Getting a 422 error when trying to upload a file? #11

Open
shealan opened this issue Sep 2, 2016 · 0 comments
Open

Getting a 422 error when trying to upload a file? #11

shealan opened this issue Sep 2, 2016 · 0 comments

Comments

@shealan
Copy link

shealan commented Sep 2, 2016

        $soundcloud = new \Soundcloud\Service(env('SOUNDCLOUD_ID'), env('SOUNDCLOUD_SECRET'));
        $soundcloud->setAccessToken('xxxxxxxxxxxxxxxxxxxxxx');

        $path = storage_path('app/test.mp3');

        $track = [
            'track[title]' => 'My amazing cool track',
            'track[tags]' => 'dubstep rofl',
            'track[asset_data]' => "@{$path}"
        ];

        try {
            return $soundcloud->post('tracks', $track);
        } catch (Services_Soundcloud_Invalid_Http_Response_Code_Exception $e) {
            exit($e->getMessage());
        }

Any ideas?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant