Just a quick update. Problem solved! It wasn't an obvious problem neither does it make any sense but here's what it was.
I know many people have struggled with this same problem so you can all now go and make it work....
My header commands were in a file called download.php this took the filename from a POST command in a form and redirected to it.
All I had to do was put a '/' after the the download.php url.
For example where I used to have this:
Code: Select all
echo '<form action="download.php" method="post">';
echo '<input type="text" name="auth">';
/*Link information and image name are posted in form*/
echo "<input type='hidden' value='" . htmlspecialchars($ImgArray[0]) . "' name='code' />\n";
echo "<input type='hidden' value='" . htmlspecialchars($_GET['maintype']) . "' name='maintype' />\n";
echo "<input type='hidden' value='" . htmlspecialchars($_GET['n']) . "' name='filename' />\n";
echo '<p>';
echo '<input type="submit" name="submit" value="Download">';
echo '</form>';
I've now got this:
Code: Select all
echo '<form action="download.php/" method="post">';
echo '<input type="text" name="auth">';
/*Link information and image name are posted in form*/
echo "<input type='hidden' value='" . htmlspecialchars($ImgArray[0]) . "' name='code' />\n";
echo "<input type='hidden' value='" . htmlspecialchars($_GET['maintype']) . "' name='maintype' />\n";
echo "<input type='hidden' value='" . htmlspecialchars($_GET['n']) . "' name='filename' />\n";
echo '<p>';
echo '<input type="submit" name="submit" value="Download">';
echo '</form>';
Notice the change in the <form action= > tag?. It's a sure fix. You need to use application/octet-stream as usual in the header function on the download.php page too.
Good Luck guys!