Log in

View Full Version : Problem with dialog box in IE



sponge.nika
01-11-2011, 10:31 AM
I have an attachement

<a href="http://mydomain.com/attachment.php?&C=cd80f871f7e8d4dfjz&id=8">CV.docx</a>

The name of CV.docx in the server is "cd80f871f7e8d4dfjz.docx", the system changed the name when file was uploaded.In attachment.php I get the attachement "Real Name" and "Changed name" from database .
After that


header("Content-type: application/octet-stream");
header("Content-disposition: attachment; filename=$RN");
$file=file_get_contents("attaches/".$FN);
echo $file;

Where $RN is the "Real Name".
And $FN is the Changed Name(Name in the server)

So when I click on a link a dialog box is displayed with "Open", "Save" and "Cancel" buttons.
If I save the file it works good.
But when I try to open the file with IE, this messages occurs

The file could not be found.
(C:\...\CV[1].docx\)

With other browsers this method is works.

cindylou
01-11-2011, 10:39 AM
is it necessary to use IE?..if it works with other browsers, then there's nothing to it i guess..if you really want to use IE, then try using scripts that the browser supports..that way, your page won't be ruined..

bluewalrus
01-11-2011, 03:52 PM
Comment out the header lines, and out put the expected variables are the values different between ie and other browsers?

You also may want to remove the first & from


?&C=cd80f871f7e8d4dfjz&id=8

the & is for additional variables since c is the first one the & is not necessary and could cause some error.


?C=cd80f871f7e8d4dfjz&id=8