473,749 Members | 2,464 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

file outside public_html

Hi.
Is it possible to pass to a script a path to a file which is outside
public_html?

I have this function :

function okno( film ){
gora = screen.height/2-315;
lewy = screen.width/2-350;
oknoFilm =
window.open(fil m,'oknoFilm','m enubar=no,locat ion=no,toolbar= no,scrollbars=n o,status=no,res izable=yes,widt h=700,height=63 0,left='+lewy
+',top='+gora +'');
oknoFilm.focus( );
}

film should be a path to html file...

but when later i'm trying to call
okno('/home/ab17661/domains/szachy.biz/filmy/film2.html');
but i'm getting IE error "file not found"

When the file was in public_html folder
okno('filmy/film2.html');
was working fine

I need to make sure that only registered users will access this file that's
why i put it outside public_html

Could you help me?

Thanks.
Leszek
Jul 31 '06 #1
1 1947

Leszek wrote:
Hi.
Is it possible to pass to a script a path to a file which is outside
public_html?
That invalidates the purpose of a web server. Your script (or any
agent) requests files from the server. If the file is not within the
domain of publicly available files specified to the server, you're SOL.

Rather, you need to implement some kind of user authentication (basic,
digest, ip restriction, custom server-side script and database) that
prevents unauthorized users from accessing the content.

Jul 31 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
2564
by: Marcus | last post by:
I am trying to auto-detect what folder a file is sitting in and based upon this info, query a MySQL database to get further information. I have been all over php.net and been through numerous examples, but I can't get my script to do exactly what I want... An example given on php.net regarding dirname() is as follows: dirname can be used to create self referencing web scripts with the following one liner.
8
3007
by: jerrygarciuh | last post by:
Hello, If you have the whole server path for a file is there a canonical way to get the path from document root for that file so that you can present the file ina browser or for download? Check $_SERVER and parse the path? My thought is that given OS diversity and individual server differences (eg www vs public_html vs htdocs) that there may be no one-size-fits-all solution but I thought I would throw this out there any way.
10
4756
by: StevePBurgess | last post by:
I would like to make my downloads section unbrowsable (to users) but accessible to scripts. Can I deliver a file to a browser without linking to it's URL so that I can deliver files programmatically but prevent users from browsing or linking to them? I am using PHP on an apache server. Ta
13
3426
by: raykyoto | last post by:
Hi all, I'm sure this is a popular question that comes up every few months here. Indeed, I've looked at some of the past postings, but I would like to ask things differently. Basically, I'm using a flat file to storing data. I have to do this because mySQL is not installed on my web server, and I am not the root user. The amount of data is so small, that it isn't worth a full-blown database anyway. However, while the data is...
4
1763
by: Brad | last post by:
I have a file that downloaded a CSV file for the user based upon some information gathered from the Database. My file was working fine until recently (I believe that my hosting company did something when they upgraded to PHP5). Everytime a user tries to download the file, it displays the contents on the screen. Here is what I have for my file handling. Am I missing anything obvious? when called, $filecontent is displayed to the...
1
1757
by: Michael Satterwhite | last post by:
This is something I always have trouble keeping straight. Assume I have a file tree as follows: /home /home/me /home/me/public_html /home/me/public_html/dir1 /home/me/public_html/dir2 My web pages are under either public_html or public_html.dir1. If I want to
2
1990
by: theSammy95 | last post by:
I have a small Linux webserver, and want to find a (php) script that lets my users download files located outside of the public_html folder Anyone that knows how or have a readymade solution? Sammy
2
2567
by: phpnoob | last post by:
I have a php script that processes a form and then posts the user input to a data file on the server in a comma delimited format. For simplicity call the file "data.csv." The script is working well and the data is posted correctly to the data file. The big problem is that anyone can point their web browser to www.mywebsite.com/data/data.csv and see exactly what is contained in the data file. Obviously, I want the data in that file to...
2
2403
Jezternz
by: Jezternz | last post by:
Ok, basicly I have a php script that calls apon files using readfile(), which works as it should, however I want to create a folder (in public_html) where ONLY readfile() can get the files, but the general public/web does not have access too. I realize I could just put the folder outside public_html, and it would work, however assuming I don't want too, are there some sorta permissions or something i can use? Summed up: How can I give...
0
8832
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9566
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
9333
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8256
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6078
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4608
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4879
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3319
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2791
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.