karthikvasan Posted July 13, 2012 Share Posted July 13, 2012 Hi, i done php code for download mp3 file and its working perfectly. but the issues is when i download the mp3 file the tags (artist, album,...) are not copied from sourcefile. my code is: header('Content-type: audio/mpeg'); header('Content-length: ' . filesize($songlistpath[$ival])); header('Content-Disposition: filename="'.$songlistpath[$ival].'"'); header('X-Pad: avoid browser bug'); header('Cache-Control: no-cache'); print file_get_contents($songlistpath[$ival]); i set tags (Title , subtitle, rating,comments,album,artist, genre, length, name, type) in source mp3 file. but after download that file, these tags are not available in the new mp3 file (downloaded file) . how can i solve it. thank you By Karthik Quote Link to comment https://forums.phpfreaks.com/topic/265604-download-mp3-file-in-php/ Share on other sites More sharing options...
karthikvasan Posted July 13, 2012 Author Share Posted July 13, 2012 hi Friends i need it urgent friends pls help me. by Karthik Quote Link to comment https://forums.phpfreaks.com/topic/265604-download-mp3-file-in-php/#findComment-1361284 Share on other sites More sharing options...
ManiacDan Posted July 13, 2012 Share Posted July 13, 2012 Are you sure the tags are part of the file? Some music players store the tags outside of the file itself. Also, bumping threads is against the rules. You posted in the middle of the night US time. Quote Link to comment https://forums.phpfreaks.com/topic/265604-download-mp3-file-in-php/#findComment-1361289 Share on other sites More sharing options...
karthikvasan Posted July 13, 2012 Author Share Posted July 13, 2012 Hi, opz sorry for that. here after i wont do this mistake. coming to my issue. im sure that tags are part of the mp3 file not stored in outside. when i download the same file through filezilla the tags are perfectly available in that file. By Karthik Quote Link to comment https://forums.phpfreaks.com/topic/265604-download-mp3-file-in-php/#findComment-1361295 Share on other sites More sharing options...
Psycho Posted July 13, 2012 Share Posted July 13, 2012 Are you sure you are downloading the file? If your browser has a default mp3 player it will play that file - not download it. At least that is my experience using two different browsers with that script. Each browser used a different app to play the file. So, it could be something to do with the browser you are using and how it is configured to handle mp3 files or the default player. If you are wanting to download the file, then you should force the file to download instead of using the default handler for mp3 files as configured in your browser. Just do a search for "PHP force download" and I'm sure you find plenty of scripts. Otherwise, if your intention is to play the mp3 file directly from the browser then you should look at setting a different default player in your browser. Quote Link to comment https://forums.phpfreaks.com/topic/265604-download-mp3-file-in-php/#findComment-1361304 Share on other sites More sharing options...
karthikvasan Posted July 13, 2012 Author Share Posted July 13, 2012 thank u Psycho. i can download the mp3 file through my php script. and sure that the mp3 file not playing on browser, i just keep this script only for download. its working fine. the only thing is the properties/tags of the mp3 file. i dont know why the original tags of the files are removed after download it. i want to keep the tags for source mp3 file in the downloaded file. Ex: Title , subtitle, rating,comments,album,artist, genre, length, name, type and etc... these tags are available in source mp3 file. but after download it through php the tags are removed. i dont know how to rectify it. By Karthik Quote Link to comment https://forums.phpfreaks.com/topic/265604-download-mp3-file-in-php/#findComment-1361309 Share on other sites More sharing options...
Psycho Posted July 13, 2012 Share Posted July 13, 2012 thank u Psycho. i can download the mp3 file through my php script. and sure that the mp3 file not playing on browser, i just keep this script only for download. its working fine. the only thing is the properties/tags of the mp3 file. i dont know why the original tags of the files are removed after download it. i want to keep the tags for source mp3 file in the downloaded file. Ex: Title , subtitle, rating,comments,album,artist, genre, length, name, type and etc... these tags are available in source mp3 file. but after download it through php the tags are removed. i dont know how to rectify it. You're not going to get anywhere by repeating the same thing you stated before. I don't think you really read my post and understood it. I ran your script with an MP3 file and in IE and FF the file was played using two different players (and the tags were displayed). This tells me that with that script the browser is determining what to do with the file. So, if your browser is downloading the file as opposed to playing it - the browser might be using some alternative download method that is stripping out the tags. As I stated before you should try using a method that does a force download. If the problem is due to some alternative download method then this could solve the problem. Quote Link to comment https://forums.phpfreaks.com/topic/265604-download-mp3-file-in-php/#findComment-1361319 Share on other sites More sharing options...
karthikvasan Posted July 16, 2012 Author Share Posted July 16, 2012 Hi i tried my level best. but still facing the same issue :'( :'( :'( Quote Link to comment https://forums.phpfreaks.com/topic/265604-download-mp3-file-in-php/#findComment-1361911 Share on other sites More sharing options...
ManiacDan Posted July 16, 2012 Share Posted July 16, 2012 Did you read the TWO posts now about other things you can try? Specifically, the one above yours that talks about how you don't seem to have read or understood the posts you've been given. Quote Link to comment https://forums.phpfreaks.com/topic/265604-download-mp3-file-in-php/#findComment-1361947 Share on other sites More sharing options...
karthikvasan Posted July 17, 2012 Author Share Posted July 17, 2012 yes i tired all possibilities which are mentioned above.. but still getting same. you if have php script to download the mp3 file perfectly pls suggest Quote Link to comment https://forums.phpfreaks.com/topic/265604-download-mp3-file-in-php/#findComment-1362058 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.