🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.jbuilder.java.language
Article #7397

Re: file access in browser - security problem

#7397
From: John McGrath TeamB
Date: Tue, 26 Jun 2001 07:06
34 lines
2169 bytes
On Mon, 25 Jun 2001 21:04:05 GMT, webseal wrote:

> in my applet I try to read some data out of an text file,
> that is stored in the same URL as the applet class on the
> server.
> 
> I use the following construct to read the file

There are two problems here.

First, the File class is used to identify a file on a local file 
system.  When you run in the AppletViewer, the file is on a local
file system, so there is no problem.  But that would not work over
the net.  Your applet would be executing within the browser in the
client's machine, and the file would be on the HTTP server.

Even if the file were located on the client machine, you would not
be allowed to read it from an Applet, unless you had signed the
Applet and given it permission to read the local file system.

There are ways to get a resource from the JAR file that contains
you class files, but I understand that there are some problems
with different browsers' implementations of this.  Try posting on
the "applet-issues" newsgroup -- people there will be more familiar
with the issues.

-- 
Regards,

John McGrath [TeamB]

---------------------------------------------------
Before sending me e-mail, please read:
    http://www.JPMcGrath.net/newsgroups/e-mail.html
Technical Details
Message-ID: <MPG.15a1f9bdbd0dd1ea98a2e1@forums.borland.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!newsfeed.google.com!sn-xit-02!supernews.com!peer.news.opaltelecom.net!newsfeed.wirehub.nl!newsfeeds.belnet.be!news.belnet.be!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!dnews
References: <3b37a31f.27266020@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f74b3,5c9fc3a5ac4eaeb1
X-Google-Attributes: gidf74b3,public
X-Google-ArrivalTime: 2001-06-26 00:09:40 PST
From: John McGrath  [TeamB] <ng-b@JPMcGrath.net>
Newsgroups: borland.public.jbuilder.java.language
Subject: Re: file access in browser - security problem
Date: Tue, 26 Jun 2001 03:06:42 -0400
Message-ID: <MPG.15a1f9bdbd0dd1ea98a2e1@forums.borland.com>
References: <3b37a31f.27266020@newsgroups.borland.com>
X-Newsreader: MicroPlanet Gravity v2.30
NNTP-Posting-Host: 209.92.40.60
X-Trace: dnews 993539200 209.92.40.60 (26 Jun 2001 00:06:40 -0700)
Lines: 34
X-Authenticated-User: jpmcgrath
Path: arc1-ca.pugleaf.net!archiver1.google.com!newsfeed.google.com!sn-xit-02!supernews.com!peer.news.opaltelecom.net!newsfeed.wirehub.nl!newsfeeds.belnet.be!news.belnet.be!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!dnews