Download Script

liunx

Guest
I installed Group-Office for an Intranet, but the download.php script doesn't work on the TCH server (works on my dev box, PHP 4.2.1 Apache 1.3.22). It displays the unencoded document in the browser.<br /><br />Anyone have a download script that works on TCH?<br /><br />Thanks!<br />Ellen<!--content-->
Ellen, I'm not sure what you need from a PHP download script. Download count? Referrer tracking? I know I posted something about this here on the forums not long ago but I can't seem to find the post <img src="http://www.totalchoicehosting.com/forums/style_emoticons/default/sad.gif" style="vertical-align:middle" emoid=":(" border="0" alt="sad.gif" /><br />Anyway, these <a href="http://www.google.com/search?q=php+download+script" target="_blank">google</a> <a href="http://www.google.com/search?q=php+download+counter" target="_blank">searches</a> provided some links which might give you what you need.<br /><br />Hope this helps.<br /><br />If it's not what you want or if you need help setting it up, just post a message here and I'll be glad to help you find something that suits your needs or help you with the instalation of the script <img src="http://www.totalchoicehosting.com/forums/style_emoticons/default/smile.gif" style="vertical-align:middle" emoid=":)" border="0" alt="smile.gif" /><!--content-->
I'm using the download script to view various files online that are located outside of the document root so that I can maintain security on who can view the files. For example, if you go to <a href="http://www.atlrecsvc.com/groupoffice" target="_blank">http://www.atlrecsvc.com/groupoffice</a> and login with pro1/pro1 - then click on the "Files" icon - click on the Daily Report folder - you will see a link to a word document. Right now the download.php script shows the document un-encoded. The download script works fine on my Linux server at home running PHP 4.2.1, and I can view the MS Word document.<br /><br />The download script is responding just like the cPanel "Show File" in the File Manager. Is this how File Manager is supposed to behave? <br /><br />Thanks!<br />Ellen<!--content-->
Hmm... that seems like an incorrect MIME type...<br /><br />Check the MIME types on your CPanel, perhaps you're missing the MS Word one. If that's the case, try adding it:<br />application/msword<br /><br />But I don't think that's the problem, though, since all servers have (or at least should have) that MIME type installed by default.<br /><br />I don't know Group-Office but I'd say the problem is that the PHP code isn't setting the MIME type for the downloaded data, and so the browser thinks it's receiving an HTML page instead of a Word attachment, so it proceeds accordingly: it shows the document on it's window instead of offering a download dialog to the user.<br /><br />Still, you say this works on your linux dev-box, so it should work here at TCH without any problems...<br /><br />I guess I'll have a look at that Group-Office and try to find the problem. I'll post here if I find something.<!--content-->
 
Back
Top