Reading files in an applet


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 3 of 3

Thread: Reading files in an applet

  1. #1
    Join Date
    Apr 2003
    Posts
    4

    Reading files in an applet

    I am making a very simple applet that reads a file and displays it to the user. The files are located on the web server, not the user's machine. The applet works wonderfully when I use sun's applet viewer, but doesn't when I load it in a browser, instead I get a security error. Is there a simple way to read the file without creating a servlet?

  2. #2
    Join Date
    Mar 2003
    Posts
    86

    Applet & Resouces

    You say: The files are located on the web server.
    That sounds good. How does the applet load the files?

    Should get them from the server (best to use http), and load then from the client.

    Sharbov.

  3. #3
    Join Date
    Apr 2003
    Posts
    4

    Smile

    Ok, I fixed my problem. I used a URL, and it works now. I actually tried that before posting this here, but it didn't work. The problem was I tried to access the files on my webserver when I was running the applet from my hard drive. Once I changed the path in the URL to "file:C:\path of file" it worked great. Then I just change it to the http reference before I upload it to the webserver and it works great.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center