Re: Displaying files

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



>
>  Because as I mentioned before PHP runs as a different user to your
>> browser.
>>
>> -Stut
>
>
Stut,

Are you referring to this?

"If you're using IIS then it's the IUSR_machine user which doesn't have
access to the network by default"

The IUSR_SERVERNAME account is what it should be connecting as whether I'm
using PHP/Javascript/HTML, unless specifically set in a connection string
such as the database connections.  But, the initial calls always come from
IUSR_SERVERNAME.

Thiago,

HTML WORKS
<a href=\\server\folder\file.xls target="_blank">Open</a>

Javascript WORKS
function openWin(folder,file) {
 var LeftPosition = (this.screen.width) / 2;
 var TopPosition = (this.screen.height) - this.screen.height;
 var Height = (this.screen.height) - 90;
 var Width = (this.screen.width) /2 - 10;
 MyWin = window.open(\\\\server\\"+folder+"\\"+file+"\.xls","ViewImage","scrollbars=yes,
status=yes,
resizable=no,top="+TopPosition+",left="+LeftPosition+",width="+Width+",height="+Height+"");
 MyWin.focus();
}

PHP DOESN'T WORK
$filename = "\\\\server\\".$folder."\\".$file.".xls";
header("Content-Type: application/x-msdownload");
readfile($filename);

I put all three of these examples into the exact same page.  The HTML and
Javascript open the file without any problems, but PHP cannot open it.

[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux