Article View: borland.public.jbuilder.java.language
Article #7314Re: file access in browser - security problem
From: Rich Wilkman
Date: Tue, 26 Jun 2001 16:23
Date: Tue, 26 Jun 2001 16:23
48 lines
2675 bytes
2675 bytes
You can read files from the server your Applet came from all day long
without signing. You can't use the File object to do it (it represents
a local file which would be the client machine and a no-no for an
Applet). You do it the old fashioned way by opening a stream to the
file and sucking down the bytes. No signing, no extra costs.
-Rich
dnoyeB wrote:
>
> You cant read files with an applet unless it is signed. Signing applets
> will cost you ~$400. It will cost you $400 to read files with your applet.
> take it or leave it...
>
> experimentlally you can turn off your browwser security with MSIE (not
> nutscrape). You can generate fake certificates and accept them on your
> computer. If you gotta start messing with certs, its gonna be a headache.
>
> "webseal" <webseal@web.de> wrote in message
> news:3b37a31f.27266020@newsgroups.borland.com...
> > Hi,
> > 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
> >
> > stdFile = new File("file.txt");
> > try
> > {
> > fileIn = new BufferedReader(new FileReader(stdFile));
> > }
> > catch (IOException e)
> > {
> > System.out.println("...");
> > }
> >
> > If I start the applet within jbuilder in the appletviewer, everything
> > works fine.
> > But if I start the html-file, that starts the applet in browser I get
> > an error in the browser:
> > com.ms.securitiy.SecurityExceptionEx(..) cannot access file file.txt
> >
> > I think there is a security problem when connecting to the file.
> > Should I use another read-method, instead of bufferedreader(new
> > filereader ...)?
> > Help appreciated
> >
> > Webseal
Technical Details
Message-ID:
<3B38B705.154DC319@formlessvoid.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!newsfeed.google.com!sn-xit-02!supernews.com!nntp-relay.ihug.net!newsfeeds.ihug.co.nz!ihug.co.nz!dnewsReferences:
<3b37a31f.27266020@newsgroups.borland.com> <3b388af0$1_1@dnews>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 09:31:19 PST Message-ID: <3B38B705.154DC319@formlessvoid.com> Date: Tue, 26 Jun 2001 09:23:33 -0700 From: Rich Wilkman <richw@formlessvoid.com> X-Mailer: Mozilla 4.77 [en] (Windows NT 5.0; U) X-Accept-Language: en MIME-Version: 1.0 Newsgroups: borland.public.jbuilder.java.language Subject: Re: file access in browser - security problem References: <3b37a31f.27266020@newsgroups.borland.com> <3b388af0$1_1@dnews> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit NNTP-Posting-Host: 208.236.69.60 X-Trace: dnews 993572613 208.236.69.60 (26 Jun 2001 09:23:33 -0700) Lines: 48 Path: arc1-ca.pugleaf.net!archiver1.google.com!newsfeed.google.com!sn-xit-02!supernews.com!nntp-relay.ihug.net!newsfeeds.ihug.co.nz!ihug.co.nz!dnews