php-echonest-api icon indicating copy to clipboard operation
php-echonest-api copied to clipboard

Is Local File Upload Supported?

Open kengle3 opened this issue 12 years ago • 8 comments

I could easily be doing it wrong, because I know the process is different for local files than urls.

Here is a minimized function call of what I'm attempting to do: $results = $results->upload('../Libraries/54 The Con.m4a', true, 'm4a',$_FILES);

Currently this call just fails with no error message. My best guess is that passing $_FILES is not the correct way to pass the track, but I can't think of any way to pass it otherwise.

I tried unrolling it to the request() function, and I thought from the variable name" $url" it may be assuming a url is being passed. PHP isn't my strongest language though.

kengle3 avatar Mar 13 '12 21:03 kengle3

kengle3, were you able to find a solution? I'm in the exact same boat as you -- I can't for the life of me figure out what to pass to the 'track' parameter..

C0DESTR0NG avatar Apr 26 '12 02:04 C0DESTR0NG

The current version of these bindings does not support local file upload.

However, we did have someone modify the source code for our project to add the functionality. I suggested that he take the time to contribute the the code back to the project.

I will see him next on Friday and let him know someone expressed interest in his solution. If he isn't interested in cleaning up the code, then I'll try to clean it up and submit it myself with his permission.

It may take a bit to get around to it though because we are both university students dealing with finals for the next two weeks.

kengle3 avatar Apr 26 '12 05:04 kengle3

I am wondering what the status is of this. I am trying to feed an mp3 that is located on my webserver to the echonest analyser (I've already written the uploader part).

Is it possible in any way to pass the analyzer a url to analyse?

dorienh avatar Jun 19 '13 10:06 dorienh

Yes, I've added the methods for this.  — Brent Shaffer

On Wed, Jun 19, 2013 at 4:20 AM, dorein [email protected] wrote:

I am wondering what the status is of this. I am trying to feed an mp3 that is located on my webserver to the echonest analyser (I've already written the uploader part).

Is it possible in any way to pass the analyzer a url to analyse?

Reply to this email directly or view it on GitHub: https://github.com/bshaffer/php-echonest-api/issues/15#issuecomment-19674460

bshaffer avatar Jun 19 '13 13:06 bshaffer

Thank you for your quick response! I guess I can do it with $trackApi = $echonest->getTrackApi();

Do you happen to have any additional pointer, as I can't really find any documentation and I am new to this. Thanks!

Edit... oh no, it seems that there is an upload function, still not really sure how to use that though. If you would have an example, would be extremely useful!

dorienh avatar Jun 19 '13 14:06 dorienh

What is the right way to call the getTrackApi()->upload method?

What is exactly expected in the 'track' field of the array parameter of the upload method? Is it just the url towards the mp3 file I want to upload or is is the file converted in special data model. If you could give a simple example it would be awesome. Thx

Lamorale avatar Jul 31 '13 14:07 Lamorale

Hi, bshaffer! I hope you're still reading reviews ... For several days trying to sort out your echonest api library but the result is sad. My attempts to recognize local files fail. Please tell me how to use the upload function. i've tried: $ results = $ echonest-> getTrackApi () -> upload ($ dir. '/'. $ file, 'true', 'mp3', $ buckets);

unfortunately does not show errors.

yuriiua avatar Apr 03 '15 20:04 yuriiua

Hello! Unfortunately I have not been keeping this library up-to-date… I'm not sure why the upload function would fail. Perhaps echo nest has changed their APIs? If you find out please let us know.

On Friday, April 3, 2015, urii [email protected] wrote:

Hi, bshaffer! I hope you're still reading reviews ... For several days trying to sort out your echonest api library but the result is sad. My attempts to recognize local files fail. Please tell me how to use the upload function. i've tried: $ results = $ echonest-> getTrackApi () -> upload ($ dir. '/'. $ file, 'true', 'mp3', $ buckets);

unfortunately does not show errors.

— Reply to this email directly or view it on GitHub https://github.com/bshaffer/php-echonest-api/issues/15#issuecomment-89410210 .

Sincerely, Brent Shaffer @bshaffer http://twitter.com/bshaffer

bshaffer avatar Apr 03 '15 23:04 bshaffer