Page 1 of 1
how to open a file ??
Posted: Wed Feb 24, 2010 2:05 am
by rrn
hi
my website is in php .
am using a javascript code to open a file .
Code: Select all
function dec()
{
window.open("www.test.com/files/2010/test.pdf");
}
when i click the hyperlink connected to this function , a browser window is opened .path to the file will be dispaled in the address bar
i dont want it like tat.
i need to open only the file test.pdf , not in browser window so that path will not be seen .
pls help.
Re: how to open a file ??
Posted: Wed Feb 24, 2010 2:37 am
by pbs
There are different options in window.open for statusbar, titlebar etc.
Refer:
http://www.houseofscripts.com/scripts/j ... penwin.htm
Re: how to open a file ??
Posted: Wed Feb 24, 2010 7:22 am
by rrn
That didnt help
Code: Select all
<html>
<head>
<script type="text/javascript" language="JavaScript">
function OpenLink(theURL)
{
window.open(theURL);
}
</script>
</head>
<body>
<a href="javascript:OpenLink('www.test.com/filename.pdf')">Test</font></a>
</body>
</html>
when i click "test" , a browser window is opened showing filename.pdf , path to the file is also shown in he address bar.
the file should not be opened in a browser window , it should open as a pdf file .
or
i should hide the path to the file in the browser window.
any help is appreciated .
thanks
Posted: Sat Feb 27, 2010 11:51 pm
by Jonah Bron
Did you look at the code in the page given? This is an excerpt:
window.open('../index.html', 'myWin', 'resizable=yes,toolbar=no,location=no,directories=no,
status=no,menubar=no,scrollbars=yes')
This shows the syntax for giving the window parameters.