On 8/15/08, Dan Shirah <[EMAIL PROTECTED]> wrote:
>
>
> 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();
> }


You JavaScript works because it's opening a Window and pointing it's URL to
a directory your BROWSER has access, that's client-side.
If I run your JS (or your HTML) code, it will not work as I don't have
access to that \\server share.

PHP (and your HTTP server) are on server-side, and they're not having access
to your file.


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.
>



-- 
Thiago Henrique Pojda

Reply via email to