I am allowing my users to upload mp3 files just so I can read the metadata and extract the Song Title and Singer Name.
At the moment I am uploading the file and using getId to read the meta data. The upload of course takes a lot of resources and bandwidth. And it seems kind of wasteful to upload the mp3s since all I need are 2 pieces of information and I won’t even be doing anything with the file itself. So I delete it afterwards.
Is it possible to get these 2 pieces of information on the client side without copying the file to my server?
you can only do this in HTML5 compliant browsers that implemented the FileReader interface (Firefox, Chrome, IE10, Safari 5.1+, not sure about Opera).
You basically use FileReader to get the contents of your file into memory and then manually scan (in client-side javascript) for the MP3 tags you want.