Chadduck Posted April 27, 2012 Share Posted April 27, 2012 I am haing difficulty with modifying an admin module to work within the 2.3.1 environment that works fine in a 2.2RC2a environment. The module creates a file, stores the file, and when user presses the DL FILE button the file displays on the screen instead of being sent to the user. I have spent close to 24 hours researching this, on php sites, OSC sites, and here. It makes no sense since if the file is called direct by URL the browser says "where you wanna put it?" The only modification done to the working 2.2RC2a mod was removal of the tab menu and making it into a "box" on the admin screen. EVERYTHING except the file download portion works. It writes to the db, reads the db, creates the necessary file in the correct format, the file imports to the user's final program correctly like I said it works CORRECTLY except the DL. Code environment is Apache, PHP 5.3.2, and MySQL 5.1.41 - also the "admin/output" directory is 777. HERE IS THE CODE BEING USED. I even inserted extra echo cmds to ensure that each step was seen. Each step was reached, at least the echo cmd was sent to the screen but still no DL only screen display. // Download file if (DL_FILE==1) { /* ORIG */ $filename="output/orders.iif"; $size=filesize($filename); header("Pragma: public"); header("Cache-Control: private"); header("Content-Type: Application/octet-stream"); header("Content-Disposition: attachment; filename=orders.iif"); header("Content-length: $size"); readfile($filename); I have been stuck on this for 5 days... I have tried countless variations of code for this found on many different sites. ANY and ALL suggestions would be helpful cause quite frankly I can not see WHY it is NOT working. (not to mention I am going bald from pulling out my hair LOL) Thank you in advance, BJ Quote Link to comment Share on other sites More sharing options...
Chadduck Posted May 4, 2012 Author Share Posted May 4, 2012 anyone have an idea? Is the code correct? Quote Link to comment 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.