473,499 Members | 1,618 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

security error accessing a file

hi all.
I have a script that tries to open a file that is on a different folder than
the one in which i am working.
that is the script:

openmydoc= "file://///192.168.1.1/web/" + type+ "/" + year+ "/" + Month+
"/myfile.xyz" ;
open(openmydoc);
the proble is that on the javascript console i have a message that alerts me
about a security error.
it says "content at http://192.168.1.1/myfldr/mydoc.htm may not load or link
to file:///// 192.168.1.1/web/..."
but if I try to open my link writing by hand the address
file://///192.168.1.1/web/... it works.
the server is apache.
any idea about how to handle this?
tia.
Jul 23 '05 #1
5 2153
ilKaos wrote:
hi all.
I have a script that tries to open a file that is on a different folder
than the one in which i am working.
that is the script:

openmydoc= "file://///192.168.1.1/web/" + type+ "/" + year+ "/" + Month+
"/myfile.xyz" ;
open(openmydoc);
the proble is that on the javascript console i have a message that alerts
me about a security error.
it says "content at http://192.168.1.1/myfldr/mydoc.htm may not load or
link to file:///// 192.168.1.1/web/..."
but if I try to open my link writing by hand the address
file://///192.168.1.1/web/... it works.
the server is apache.
any idea about how to handle this?
tia.

Hi,

The first argument for window.open (url, target, etc.etc..)
is url.

A URL starts with http://
NOT with file://

You feed something different. (a file on a share somewhere)
What do you expect Javascript to do excactly?
(Javascript cannot open files on a filesystem.)

If the file://///192.168.1.1/web/etcetc is also reachable via http, I
suggest you use that route.

SO if the content of your share is also reachable via a webserver, figure
out the URL, and use that.

Regards,
Erwin Moller
Jul 23 '05 #2
>
Hi,

first of all, thanks for your kind answer.

The first argument for window.open (url, target, etc.etc..)
is url.

A URL starts with http://
NOT with file://
i thought it could work even with file...my mistake.
You feed something different. (a file on a share somewhere)
What do you expect Javascript to do excactly?
(Javascript cannot open files on a filesystem.)
that (of course) is just what i need...

If the file://///192.168.1.1/web/etcetc is also reachable via http, I
suggest you use that route.
SO if the content of your share is also reachable via a webserver, figure
out the URL, and use that.

Regards,
Erwin Moller

you mean by having somethnig like http://192.168.1.1/web/etc/mtyfile.xyz?
it works, but the problem is that it does not open the file with the
appropriate plugin but rather tries to
open it with the browser itself. this does not happen if i refer to the file
with file://///192.168...

maybe i should specify something at the "apache level" to make the browser
capable of understanding to open
the file with the appropriate plugin? something like mim type
xyz/use_my_plugin ?

thanks again.
Jul 23 '05 #3
ilKaos wrote:

Hi,

first of all, thanks for your kind answer.


You are welcome. :-)
The first argument for window.open (url, target, etc.etc..)
is url.

A URL starts with http://
NOT with file://
i thought it could work even with file...my mistake.


The fact that a browser (sometimes) opens a file for you (when you point to
it by just typing the location into the URL) probably mislead you in
thinking that that is a normal procedure.
(But it is not)
You feed something different. (a file on a share somewhere)
What do you expect Javascript to do excactly?
(Javascript cannot open files on a filesystem.)
that (of course) is just what i need...

If the file://///192.168.1.1/web/etcetc is also reachable via http, I
suggest you use that route.

SO if the content of your share is also reachable via a webserver, figure
out the URL, and use that.

Regards,
Erwin Moller

you mean by having somethnig like http://192.168.1.1/web/etc/mtyfile.xyz?


yes.
it works, but the problem is that it does not open the file with the
appropriate plugin but rather tries to
open it with the browser itself. this does not happen if i refer to the
file with file://///192.168...

maybe i should specify something at the "apache level" to make the browser
capable of understanding to open
the file with the appropriate plugin? something like mim type
xyz/use_my_plugin ?
I don't think you have to fiddle with apache to get it done.

But I am not sure what file you are trying to load.

Try this:
1) figure out the URL http://192etcetc to the file you need in Javascript.
2) Try to feed that URL to the object/embed you are using on your page.

A simple example with an image (based on some var named month):
var myImageLocation = "http://192.168.1.1/web/"+month+"/serverload.gif";

document.images["servloadimage"].src=myImageLocation;

And somewhere in you document:
<img src="default.gif" name="servloadimage">

Try to do the same with the object/embed you are using.
If you don't know the excact syntax, google for it.
(Tip: ALso try google groups to search all the newsgroupspostings in the
past)

Good luck!

Regards,
Erwin Moller

thanks again.


Jul 23 '05 #4
Try to do the same with the object/embed you are using.
If you don't know the excact syntax, google for it.
(Tip: ALso try google groups to search all the newsgroupspostings in the
past)

Good luck!

Regards,
Erwin Moller


again, thanks a lot for your kind answer.
i will try what you suggest as soon as possible.
as you probably understood i am not deep in javascript but just using it
in some of the web pages that i am creating with cgi and iseries(as400).

the file that i need to open is an .afp (ibm print format), there is a
plugin that seem to
work only with Ie (and with the conditions i explained in the above
messages).
i am new to js but not so newbie not to try a research with google groups (i
wrote in usenet
since '96 and used deja/google groups since then).
but the problem is that not so many people seem to open afp files from a
web page, or at least they
do not seem to use the web/usenet to help poor guy like me...

hope that your suggestion will work and in any case they were important for
me to
understand some of the js concepts.
thanks and "ciao".

Jul 23 '05 #5
In article <34*************@individual.net>,
"ilkaos" <12********@katamail.it> wrote:
the file that i need to open is an .afp (ibm print format), there is a
plugin that seem to
work only with Ie (and with the conditions i explained in the above
messages).


My understanding is this:
1) you put in a link to your file <a> </a> tag. It's just like a link to
a web page except the name is different.
2) web server serves up file with the correct mime type
3) browser gets the returning file.
4) Browser decides what to do. If there is a plug in for the file, the
plug in get control. If plug in isn't there, browser decides what to do.

Robert
Jul 23 '05 #6

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

Similar topics

0
1911
by: Ger | last post by:
Hi, I have a problem with a Windows Service that I have created accessing System.Management.dll on a W2k3 environment. The Service runs fine on an XP machine but the same Service causes an error...
4
2275
by: KKramsch | last post by:
My code is generating this type of error: Security Error: Content at http://nonexistent.org/somepage.html may not load data from about:blank. The "about:blank" page mentioned in the error...
5
15098
by: Nathan Bloom | last post by:
Hi, I have a secured database that runs fine on the computer the database is installed on. I have several workstations with access runtime installed that also need access to the database. ...
1
8490
by: Dave | last post by:
I am getting te following error in a ASP.Net app that is running on Win XP Pro (SP2): Server cannot access application directory 'C:\Documents and Settings\dave\My Documents\My Visual Studio...
5
1224
by: fripper | last post by:
I am having trouble accessing a datafile in m inetpub/wwwroot/_private directory from a VB .Net app that I am debugging. When I run the program I get an error saying that ASP.NET is not authorized...
10
1654
by: Richard MSL | last post by:
I am having problems working with .net security. I have been attempting to use the Microsoft .Net Framework 2.0 Configuration tool (version 2.0.50727.42), but it won't work for me. I have a simple...
3
4088
by: Asaf | last post by:
Hello, I have created a web service name "TestWS" and published it to my SBS2003 server that uses IIS6 as a web server. I have set NO anonymous access to TestWS virtual directory and I have...
3
1599
by: ajl | last post by:
I am getting following error on accessing a asp.net application from virtual directory /website. Please suggest me the solution. Server Error in '/website' Application....
0
1058
by: sunoj | last post by:
Hello friends.....! I developed a windows application using VB.Net. and Installed it on D Drive of my server Machine. The D Drive is mapped as G on all other machines. When I am...
0
7132
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7223
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6899
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...
0
7390
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
4919
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4602
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...
0
3103
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...
1
665
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
302
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.