Using media-upload.php to upload mp3 via custom fields

The fileurl should look like this:

fileurl = $('a', html).attr('href');

It’s a pretty simple fix. I would do some validation on this:

if(/\.mp3\b/.test(fileurl)){
    //Do something awesome
}else{
    alert('The file you selected is not an MP3.');
}

Cheers!

Leave a Comment