473,221 Members | 1,910 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,221 software developers and data experts.

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 2147
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
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
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
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
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
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
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
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
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
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...
1
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...
0
by: jianzs | last post by:
Introduction Cloud-native applications are conventionally identified as those designed and nurtured on cloud infrastructure. Such applications, rooted in cloud technologies, skillfully benefit from...
0
by: abbasky | last post by:
### Vandf component communication method one: data sharing ​ Vandf components can achieve data exchange through data sharing, state sharing, events, and other methods. Vandf's data exchange method...
2
by: jimatqsi | last post by:
The boss wants the word "CONFIDENTIAL" overlaying certain reports. He wants it large, slanted across the page, on every page, very light gray, outlined letters, not block letters. I thought Word Art...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: fareedcanada | last post by:
Hello I am trying to split number on their count. suppose i have 121314151617 (12cnt) then number should be split like 12,13,14,15,16,17 and if 11314151617 (11cnt) then should be split like...
0
by: stefan129 | last post by:
Hey forum members, I'm exploring options for SSL certificates for multiple domains. Has anyone had experience with multi-domain SSL certificates? Any recommendations on reliable providers or specific...
0
Git
by: egorbl4 | last post by:
Скачал я git, хотел начать настройку, а там вылезло вот это Что это? Что мне с этим делать? ...
1
by: davi5007 | last post by:
Hi, Basically, I am trying to automate a field named TraceabilityNo into a web page from an access form. I've got the serial held in the variable strSearchString. How can I get this into the...

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.