spikypunker Posted February 12, 2009 Share Posted February 12, 2009 Hey guys, have asked a few questions recently and everyones been a GREEEAT help. Recently posted http://www.phpfreaks.com/forums/index.php/topic,238039.msg1108811.html#msg1108811 topic and got it all working great. HOWEVER, today i phoned up my hosters and requested the POST limit of my site to be increased to allow people to upload past the 8mb limit. The guy did this and for it to work he reset my server. All cool, the limit increased and all was good. BUT i went back to trying the force download and it's now not passing correctly to the force download. The page gets sent the value of the file for example, song.mp3 then the SAVE AS window pops up and the file is shown and the user is given the choice to save as or open with. This used to work fine but now, the SAVE AS box is only getting the filename, up to any spaces or special characters! For example, "song's.mp3" becomes song another would be "good' song.mp3" would become "good" even the dot becomes a problem for it "song.mp3" becomes "song" so windows saves the file but doesnt know what to do with it cause it doesnt save the extension!! This only happens in Firefox, not IE but it defiantly wasnt doing it before today. It's also affecting uploading of the songs, when you try and save a tracks title to the mysql, it only send the string upto any special characters!!! I've spoken to the tech guys and they dont know whats changed, does anyone have any idea?? THe advice i've been given is to make sure all URL variables are URLencoded, this is ok and i will do this, but it doesnt explain why the server would suddenly start doing this?? Nor why if i echo out the variable, i get the full string displayed on screen but when i try and force the download, the string gets cut short! ANY help would be awesome, cheers again ppl Link to comment https://forums.phpfreaks.com/topic/144976-help-was-workingnow-isnt/ Share on other sites More sharing options...
spikypunker Posted February 12, 2009 Author Share Posted February 12, 2009 If you'd like to see the page in question then please ask! Link to comment https://forums.phpfreaks.com/topic/144976-help-was-workingnow-isnt/#findComment-760795 Share on other sites More sharing options...
spikypunker Posted February 13, 2009 Author Share Posted February 13, 2009 Anyone got any idea? Link to comment https://forums.phpfreaks.com/topic/144976-help-was-workingnow-isnt/#findComment-761155 Share on other sites More sharing options...
spikypunker Posted February 13, 2009 Author Share Posted February 13, 2009 i'm gonna cry! Link to comment https://forums.phpfreaks.com/topic/144976-help-was-workingnow-isnt/#findComment-761206 Share on other sites More sharing options...
spikypunker Posted February 15, 2009 Author Share Posted February 15, 2009 arrrghh!!! i've tried everything! Link to comment https://forums.phpfreaks.com/topic/144976-help-was-workingnow-isnt/#findComment-762728 Share on other sites More sharing options...
wildteen88 Posted February 15, 2009 Share Posted February 15, 2009 I am assuming you're using the script here. Can you post some example urls of how you're accessing your script. It is recommended to not have any spaces within urls. You should use an underscore as a replacement, eg file_name.mp3 Link to comment https://forums.phpfreaks.com/topic/144976-help-was-workingnow-isnt/#findComment-762732 Share on other sites More sharing options...
spikypunker Posted February 15, 2009 Author Share Posted February 15, 2009 Hi there, thnks for helping. Yeah i'm using that script and also will spend some time using URLencode and will change my code so it renames the uploaded file when it saves it to the server and replaces the spaces with underscores. However i still dont get how it suddenly stopped working?? Any ideas? Link to comment https://forums.phpfreaks.com/topic/144976-help-was-workingnow-isnt/#findComment-762974 Share on other sites More sharing options...
alphanumetrix Posted February 15, 2009 Share Posted February 15, 2009 have you tried this: <?php $file = $_GET['file']; $user = $_GET['user']; header('Content-disposition: attachment; filename=Deserted.mp3'); header('Content-type: audio/mpeg'); readfile('netdog/music/Deserted.mp3', false); ?> this will force both headers. (i didn't read anything you wrote - this is just a common mistake people make with headers - so please excuse me if I'm completely off topic) Link to comment https://forums.phpfreaks.com/topic/144976-help-was-workingnow-isnt/#findComment-762989 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.