Reading file in Applet.

Hello All,
i am trying to read a file in applet. i have created a applet that reads file and prints its content. it works fine on local system but when i publish this applet in web server it gives such exceptions.
java.security.PrivilegedActionException: java.lang.reflect.InvocationTargetException
     at java.security.AccessController.doPrivileged(Native Method)
     at sun.plugin.liveconnect.SecureInvocation$2.run(Unknown Source)
     at java.security.AccessController.doPrivileged(Native Method)
     at sun.plugin.liveconnect.SecureInvocation.CallMethod(Unknown Source)
Caused by: java.lang.reflect.InvocationTargetException
     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
     at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
     at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
     at java.lang.reflect.Method.invoke(Unknown Source)
     at sun.plugin.javascript.JSInvoke.invoke(Unknown Source)
     at sun.reflect.GeneratedMethodAccessor1.invoke(Unknown Source)
     at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
     at java.lang.reflect.Method.invoke(Unknown Source)
     at sun.plugin.javascript.JSClassLoader.invoke(Unknown Source)
     at sun.plugin.liveconnect.PrivilegedCallMethodAction.run(Unknown Source)
     ... 4 more
Caused by: java.security.AccessControlException: access denied (java.io.FilePermission C:\reading\run.bat read)
     at java.security.AccessControlContext.checkPermission(Unknown Source)
     at java.security.AccessController.checkPermission(Unknown Source)
     at java.lang.SecurityManager.checkPermission(Unknown Source)
     at java.lang.SecurityManager.checkRead(Unknown Source)
     at java.io.FileInputStream.<init>(Unknown Source)
     at readFile.showContent(readFile.java:38)
Can some body say whats going on?
I am stuck over here.
Any help will be appreciated.
Regards
Jaya N pasachhe.

If you are surfing the web, and you click a link to a page that you don't know, you don't want some unknown Applet to start and be allowed access to your local harddrive or printer.
Therefore, Applets ran by the browser, run in a so-called "sandbox". Read about it.
The solution is to "sign" the applet's jar.
see http://www-personal.umich.edu/~lsiden/tutorials/signed-applet/signed-applet.html
and http://forum.java.sun.com/thread.jspa?threadID=174214

Similar Messages

  • Error on reading file in Applet

    I wrote an jfilechooser and allow the user to choose the folder. The applet will then load the file list of the folder. However, after i chose the folder, the following error occurs
    Exception in thread "AWT-EventQueue-25" java.security.AccessControlException: access denied (java.io.FilePermission C:\Documents and Settings\Developer\My Documents\My Pictures read)I know i shall edit the java.policy file. However, i would like to know how to edit it if i want to allow the applet to access all the file in client's PC.
    Thank you.

    how to sign the applet, any tutorial resources for
    this?
    Yes, it's called the internet.

  • How to read a server side file in Applet?

    When I used ZipFile like this,
    ZipFile zf = new ZipFile("http://xxx.com/res.jar");
    It throwed exception about access denied, File pemission...
    How to read a server side file in Applet?

    You generally can't tell with Stream how many bytes are going to be available. You could download the whole thing into a ByteBuffer, for example, and process it from there.
    Or you can try opening an http connection explicitly (using URL and casting the connection to HttpURLConnection and see if there's a "Content-length" header.

  • Applet reading files in in web server eg geocities

    hi ,
    i have an applet that reads files i have created in a web server. when i try to run the applet in , internet explorer i get an error message
    java.io.FileNotFoundException: nic.txt (The system cannot find the file specified)
    does anyone have any solution to this problem. do i need a policy file and if i do where do i put it.

    Applets work on the clients computer, not the server. Your applet is >trying to read nic.txt from your computer. Can't be done easily, you'd >need your own serverprogram to do the reading and pass the data to the >client... let me clarify afew points
    the applet is on a webserver eg. geocities.
    the file is also on the same directory as the applet .class file.
    so everything is on the web server,.

  • Applet read file on web

    Can applet read file on web?
    I try to write an applet that read the file on web i.e. http://lcoalhost:8080/test.txt
    The HTML page contain the applet is placed on http://localhost:8080
    URI URItemp= new URI("file:///test.txt");
    File Filetemp = new File(URItemp);
    BufferReader in = new BufferReader(new InputStreamReader(new FileInputStream(Filetemp)));the above cannot work
    Error : access denied (java.io.FilePermission \test.txt read)
    And then I add
    FilePermission fp = new java.io.FilePermission("file:///test.txt", "read");still cannot work
    Cound anyone tell me that is possible to do what I want to do?
    If yes, how?
    Thanks!!

    Applets are downloaded from web servers and execute on the client machine.
    Therefore they have no access to the web server file system, signed or not.
    They could have access to the client file system (the machine where they run),
    but for security reasons only signed applets have this privilege.
    So to answer your question, you sign if you want to access client files.
    To access web server files, you don't need to sign the applet, but you need
    to provide some method of accessing files remotely, for instance:
    - Files published for the web can be read using HTTP
    - Files can be read or writen with the help of an FTP server on the same machine as the web server
    - A servlet running on the HTTP server can collaborate with your applet to exchange files

  • Writing applets that read files hosted on a webserver.

    I have a java applet that I need to be able to read files on the webserver. IE open and render images. I know ultimately the user will end up downloading these images that are hosted on the websserver, but the java applet is set to read from it's local directory, for example, when I open up a text files, I use the path someFolder\someFile.txt. If the applet was placed in the same folder as someFolder on the webserver, how would I set it up to read from there opposed to on the machine executing the java code? Would I have to force the user to download all the resources, in thus case, wouldn't I need to to have the applet signed?

    ++++ to everything by malcolmmc (use class.getResource())
    Jeremy.W wrote:
    ...I could perform a CRC check and compare the archives with the ones on the server, but it still means I'd need to compress the archives manually every time an update is made to the files on the server.I am not sure whether you are concerned with the effort of doing this from your side. If so, use Ant to make your ..war file or whatever and just upload it (and restart the server?).
    If it is the archives (Jar or Zip) updating on the client that is your major concern, then I would definitely recommend the JNLP based option, which gives the client not only automatic update (the JWS client manages the time checks with the server), but if you want to go that far, direct programmatic access to the download API. I made a crude example (never properly finished) of downloading resources using the JNLP APIs DownloadService. (Though the standard 'auto-update' is known to be quite effective).
    Oh, and.. Of course, if you have a Java enabled server, the download servlet is known to be best for updates, incremental or otherwise.
    Does this applet really need to be embedded in a web page at all? JWS has offered these things to free-floating applets since Java 1.2, it is only recently an embedded applet could hook into the JNLP API.
    As to the 'Zip' archives of resources. Some points:
    1) It pays to split them up, especially if resources are likely to change frequently in one, but rarely for others. If you do that, webstart ensures the user only downloads the updated Jars. The only way to achieve a class/resource refresh in a conventional embedded applet ('plugin1') was to flush the class cache which would force refresh of all classes/resources.
    2) Splitting the archives according to type of resource can provide benefits in that the Jars can have different compression levels appropriate to the format.
    3) I would recommend deploying all resources, whether classes or other resources, in Jar and not Zip files. Sun has decided that no Zip will be checked to see if it is digitally signed, so Zip archives can cause problems for apps. which might need extended permissions (if it ever comes to that).

  • How to load files into applets?

    Hi,
    I have developed a quiz applet. The quiz applet will have a button by clicking which one can start quiz. The quiz will open in a Jframe.
    At first the frame shows screen to enter a username (no checking for present).
    After you click login it takes the test quiz file as input and number of questions to appear in quiz.
    After that quiz program will be reading the quiz file specified (available in the same directory), then parsing the file getting questions and answers into Objects of questionRecord.
    From these questionRecords a question will be given in the frame at random.
    Finally, score will be displayed to the user.
    The program works well when it is compiled in eclipse. When I try the same program to run in browser (I'm using Mozilla), I can't load the quiz file. I dont find any errors as it running in the browser. I dont understand where the problem might be.
    Here is the Url: http://csee.wvu.edu/~srikantv/Assign/Assignment4Applet1164649158249.html
    If you want to look at.
    Please help..
    Thanx

    You can configure the browser or the plugin so that the java console is displayed.
    Your problem is probably that an applet which isn't signed isn't allowed to read files from the local filesystem.
    Kaj

  • Reading files from clients machine through a browser

    if i have to access or use some files say C:\hello\myimage.jpg from client machine's local drive, how it can be done using some technology in Java eg applets or some other way. please read the following situation to have a better undertsanding of the problem,
    consider the following situation:
    a web application is running on client PC, and on click of a button, i have to generate a report in some format and insert some images in that report which are on clients local drive and their path is known to me say C:\ myimage.jpg.
    if the mages were on the server(where web application is hosted), then its not a prob.
    if there any other technology in java to read files from clients PC through a browser other than java

    Sign the applet.
    http://forum.java.sun.com/thread.jspa?forumID=63&threadID=524815
    second and last post

  • Reading files from a browser on clients PC

    is there anyway to read files from clients PC through browser in java, apart from signed applets.....
    plz help , its very urgent......

    taking the browser to be IE, suppose the following situation:
    a web application is running on client PC, and on click of a button, i have to generate a report in some format and insert some images in that report which are on clients local drive and their path is known to me say C:\ myimage.jpg.
    if the mages were on the server(where web application is hosted), then its not a prob.[b]
    so for doing such a thing what i have to do means, what setting i have to change of the browser .....what security setting of clients PC has to be changed...
    and how to get jar signed.
    plz tell me the procedure to do this....

  • Playing an audio file from applet

    Hi friends,
    I have a problem to be solved .
    Please help me.
    I have to play an audio file from applet.When the applet loads it shold start playing .There is a progress bar in the applet it shold alsomove corresponding to that.
    How can i do that.Give me an idea.
    I know nothing about jmf.
    I am using j2sdk1.4,windows 2000 server.

    Andrew,
    Forgive my naivety, but i struggle with JAVA! I am desperately trying to create a JAVA plugin to SERVOY and have to date been successful with a few things. Record, Playback, convert to .spx.
    I am really struggling with implementing a rewind and fastforward function of the type you have. I thought it would be easy, but it appears not.
    At the bottom is the complete code from my class that is called by the servoy plugin wrapper,
    i had thought that adding some simple jump 500 ms would have been easy in something like this:
    public AudioStream js_FastForward (AudioStream as) throws IOException {
    !!! Line or two here to move the play head forward !!!
         AudioPlayer.player.start(as);
         return as;
    Can you give me any pointers to how i code that fast forward bit.
    many thanks
    David
    package com.d2e.MyPlugin;
    import com.servoy.j2db.scripting.IScriptObject;
    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;
    import java.io.*;
    import java.awt.Button;
    import javax.sound.sampled.*;
    import org.xiph.speex.*;
    import org.xiph.speex.spi.*;
    import  sun.audio.*;    //import the sun.audio package
    public class MyPluginProvider implements IScriptObject  {
          public void JSencode()
             throws IOException{
               /** Version of the Speex Encoder */
                final String VERSION = "Java Speex Command Line Encoder v0.9.7 ($Revision: 1.5 $)";
                /** Copyright display String */
                final String COPYRIGHT = "Copyright (C) 2002-2004 Wimba S.A.";
                /** Print level for messages : Print debug information */
                final int DEBUG = 0;
                /** Print level for messages : Print basic information */
                final int INFO  = 1;
                /** Print level for messages : Print only warnings and errors */
                final int WARN  = 2;
                /** Print level for messages : Print only errors */
                final int ERROR = 3;
                int printlevel = INFO;
                /** File format for input or output audio file: Raw */
                final int FILE_FORMAT_RAW  = 0;
                /** File format for input or output audio file: Ogg */
                final int FILE_FORMAT_OGG  = 1;
                /** File format for input or output audio file: Wave */
                final int FILE_FORMAT_WAVE = 2;
                int srcFormat  = FILE_FORMAT_OGG;
                int destFormat = FILE_FORMAT_WAVE;
                int mode       = -1;
                int quality    = 4;
                /** Defines the encoders algorithmic complexity. */
                 int complexity = 3;
                /** Defines the number of frames per speex packet. */
                 int nframes    = 1;
                /** Defines the desired bitrate for the encoded audio. */
                 int bitrate    = -1;
                /** Defines the sampling rate of the audio input. */
                 int sampleRate = -1;
                /** Defines the number of channels of the audio input (1=mono, 2=stereo). */
                 int channels   = 1;
                /** Defines the encoder VBR quality setting (float from 0 to 10). */
                 float vbr_quality = -1;
                /** Defines whether or not to use VBR (Variable Bit Rate). */
                 boolean vbr    = false;
                /** Defines whether or not to use VAD (Voice Activity Detection). */
                 boolean vad    = false;
                /** Defines whether or not to use DTX (Discontinuous Transmission). */
                 boolean dtx    = false;
              //HArd code src format and dest
               // private String srcPath ="junk.wav";
              srcFormat = FILE_FORMAT_WAVE;
              destFormat = FILE_FORMAT_OGG;
              //destPath="junk.spx";
             byte[] temp    = new byte[2560]; // stereo UWB requires one to read 2560b
             final int HEADERSIZE = 8;
             final String RIFF      = "RIFF";
             final String WAVE      = "WAVE";
             final String FORMAT    = "fmt ";
             final String DATA      = "data";
             final int WAVE_FORMAT_PCM = 0x0001;
             // Open the input stream
             DataInputStream dis = new DataInputStream(new FileInputStream("junk.wav"));
             // Prepare input stream
           //DP - Sort out the Wave File
               // read the WAVE header
               dis.readFully(temp, 0, HEADERSIZE+4);
               // Read other header chunks
               dis.readFully(temp, 0, HEADERSIZE);
               String chunk = new String(temp, 0, 4);
               int size = readInt(temp, 4);
               while (!chunk.equals(DATA)) {
                 dis.readFully(temp, 0, size);
                 if (chunk.equals(FORMAT)) {
                   typedef struct waveformat_extended_tag {
                   WORD wFormatTag; // format type
                   WORD nChannels; // number of channels (i.e. mono, stereo...)
                   DWORD nSamplesPerSec; // sample rate
                   DWORD nAvgBytesPerSec; // for buffer estimation
                   WORD nBlockAlign; // block size of data
                   WORD wBitsPerSample; // Number of bits per sample of mono data
                   WORD cbSize; // The count in bytes of the extra size
                   } WAVEFORMATEX;
                   if (readShort(temp, 0) != WAVE_FORMAT_PCM) {
                     System.err.println("Not a PCM file");
                     return;
                   channels = readShort(temp, 2);
                   sampleRate = readInt(temp, 4);
                   if (readShort(temp, 14) != 16) {
                     System.err.println("Not a 16 bit file " + readShort(temp, 18));
                     return;
                   // Display audio info
                   if (printlevel <= DEBUG) {
                     System.out.println("File Format: PCM wave");
                     System.out.println("Sample Rate: " + sampleRate);
                     System.out.println("Channels: " + channels);
                 dis.readFully(temp, 0, HEADERSIZE);
                 chunk = new String(temp, 0, 4);
                 size = readInt(temp, 4);
               if (printlevel <= DEBUG) System.out.println("Data size: " + size);
           //DP ENd sort wave file 
           //Now Choose the mode , we have a file sampled at 44100
                 mode = 2; // Ultra-wideband
             // Construct a new encoder
             SpeexEncoder speexEncoder = new SpeexEncoder();
             speexEncoder.init(mode, quality, sampleRate, channels);
             if (complexity > 0) {
               speexEncoder.getEncoder().setComplexity(complexity);
             if (bitrate > 0) {
               speexEncoder.getEncoder().setBitRate(bitrate);
             if (vbr) {
               speexEncoder.getEncoder().setVbr(vbr);
               if (vbr_quality > 0) {
                 speexEncoder.getEncoder().setVbrQuality(vbr_quality);
             if (vad) {
               speexEncoder.getEncoder().setVad(vad);
             if (dtx) {
               speexEncoder.getEncoder().setDtx(dtx);
             // Display info
             // Open the file writer
             AudioFileWriter writer;
             if (destFormat == FILE_FORMAT_OGG) {
               writer = new OggSpeexWriter(mode, sampleRate, channels, nframes, vbr);
             else if (destFormat == FILE_FORMAT_WAVE) {
               nframes = PcmWaveWriter.WAVE_FRAME_SIZES[mode-1][channels-1][quality];
               writer = new PcmWaveWriter(mode, quality, sampleRate, channels, nframes, vbr);
             else {
               writer = new RawWriter();
             writer.open("junk.spx");
             writer.writeHeader("Encoded with: " + VERSION);
             int pcmPacketSize = 2 * channels * speexEncoder.getFrameSize();
             try {
               // read until we get to EOF
               while (true) {
                 dis.readFully(temp, 0, nframes*pcmPacketSize);
                 for (int i=0; i<nframes; i++)
                   speexEncoder.processData(temp, i*pcmPacketSize, pcmPacketSize);
                 int encsize = speexEncoder.getProcessedData(temp, 0);
                 if (encsize > 0) {
                   writer.writePacket(temp, 0, encsize);
             catch (EOFException e) {}
             writer.close();
             dis.close();
            * Converts Little Endian (Windows) bytes to an int (Java uses Big Endian).
            * @param data the data to read.
            * @param offset the offset from which to start reading.
            * @return the integer value of the reassembled bytes.
           protected static int readInt(final byte[] data, final int offset)
             return (data[offset] & 0xff) |
                    ((data[offset+1] & 0xff) <<  8) |
                    ((data[offset+2] & 0xff) << 16) |
                    (data[offset+3] << 24); // no 0xff on the last one to keep the sign
            * Converts Little Endian (Windows) bytes to an short (Java uses Big Endian).
            * @param data the data to read.
            * @param offset the offset from which to start reading.
            * @return the integer value of the reassembled bytes.
           protected static int readShort(final byte[] data, final int offset)
             return (data[offset] & 0xff) |
                    (data[offset+1] << 8); // no 0xff on the last one to keep the sign
         AudioFormat audioFormat;
           TargetDataLine targetDataLine;
         public Class[] getAllReturnedTypes() {
              // TODO Auto-generated method stub
              return null;
         public String[] getParameterNames(String arg0) {
              // TODO Auto-generated method stub
              return null;
         public String getSample(String arg0) {
              // TODO Auto-generated method stub
              return null;
         public String getToolTip(String arg0) {
              // TODO Auto-generated method stub
              return null;
         public boolean isDeprecated(String arg0) {
              // TODO Auto-generated method stub
              return false;
         public String js_Record (String name){
              captureAudio();
              return "Started Recording " +name;
        public String js_StopRecord (String name) throws IOException{
             //new ActionListener(){
             //   public void actionPerformed(ActionEvent e)
                  //Terminate the capturing of input data
                  // from the microphone.
                  targetDataLine.stop();
                  targetDataLine.close();
              //  }//end actionPerformed
             //};//end ActionListener
                 // JSpeexEnc ("junk.wav","output.spx");
                  JSencode();
              return "Stop Records " +name;
        //Play audio file
        public AudioStream js_Playback (String name) throws IOException{
             InputStream in = new FileInputStream("junk.wav");
             AudioStream as = new AudioStream(in);        
             AudioPlayer.player.start(as);           
             return as;
        public AudioStream js_ContPlay (AudioStream as) throws IOException {
             AudioPlayer.player.start(as);           
             return as;
         //Stop Play
        public AudioStream js_Stop_Playback (AudioStream as) throws IOException{
             AudioPlayer.player.stop(as);
              return as;
         //This method captures audio input from a
        // microphone and saves it in an audio file.
        private void captureAudio(){
          try{
            //Get things set up for capture
            audioFormat = getAudioFormat();
            DataLine.Info dataLineInfo =
                                new DataLine.Info(
                                  TargetDataLine.class,
                                  audioFormat);
            targetDataLine = (TargetDataLine)
                     AudioSystem.getLine(dataLineInfo);
            //Create a thread to capture the microphone
            // data into an audio file and start the
            // thread running.  It will run until the
            // Stop button is clicked.  This method
            // will return after starting the thread.
            new CaptureThread().start();
          }catch (Exception e) {
            e.printStackTrace();
            System.exit(0);
          }//end catch
        }//end captureAudio method  
    //  This method creates and returns an
        // AudioFormat object for a given set of format
        // parameters.  If these parameters don't work
        // well for you, try some of the other
        // allowable parameter values, which are shown
        // in comments following the declarations.
        private AudioFormat getAudioFormat(){
          float sampleRate = 44100.0F;
          //8000,11025,16000,22050,44100
          int sampleSizeInBits = 16;
          //8,16
          int channels = 1;
          //1,2
          boolean signed = true;
          //true,false
          boolean bigEndian = true;
          //true,false
          return new AudioFormat(sampleRate,
                                 sampleSizeInBits,
                                 channels,
                                 signed,
                                 bigEndian);
        }//end getAudioFormat
        class CaptureThread extends Thread{
               public void run(){
                 AudioFileFormat.Type fileType = null;
                 File audioFile = null;
                 //Set the file type and the file extension
                 // based on the selected radio button.
                 //if(aifcBtn.isSelected()){
                  // fileType = AudioFileFormat.Type.AIFC;
                  // audioFile = new File("junk.aifc");
                // }else if(aiffBtn.isSelected()){
                 //  fileType = AudioFileFormat.Type.AIFF;
                 //  audioFile = new File("junk.aif");
                // }else if(auBtn.isSelected()){
                 //  fileType = AudioFileFormat.Type.AU;
                 //  audioFile = new File("junk.au");
                // }else if(sndBtn.isSelected()){
                //   fileType = AudioFileFormat.Type.SND;
                 //  audioFile = new File("junk.snd");
                // }else if(waveBtn.isSelected()){
                 fileType = AudioFileFormat.Type.WAVE;
                 audioFile = new File("junk.wav");
                // }//end if
                 try{
                   targetDataLine.open(audioFormat);
                   targetDataLine.start();
                   AudioSystem.write(
                         new AudioInputStream(targetDataLine),
                         fileType,
                         audioFile);
                 }catch (Exception e){
                   e.printStackTrace();
                 }//end catch
               }//end run
             }//end inner class CaptureThread
    }

  • How to create a small HTML-file in Applet

    What i wan't to do is as follows:
    1. In an applet i create a string containing a small HTML-file. Its contents depends on what the user chose in the applet.
    2. then i wan't to redirect the browser to that HTML-file. appletcontext.showDocument(URL) could be used.
    The problem is how can i create an URL to a string which is only in memory.
    Writing the string to a file and then creating URL to it poses problems, as we all know, writing files from applets is difficult.
    Any help would be appreciated.

    Here is how you do it:
    1) use the JSObject (you may have to import
    netscape.javascript.JSObject depending on the
    version of your SDK) to open a window with an empty
    URL, a title , and a _blank or _self
    target.
    2) use the JSObject document.write to write the HTML
    string to the window that you opened in #1 above
    3) close the document.
    If you need further assistance, post your code and I
    can modify it for you or if you want, I can whip up a
    small demo applet for you to try.
    ;o)
    V.V.Thanks!! Your post has been very helpful. One question though, I suppose the client has to have a java-plug-in installed in his/her web-browser, is that right?

  • How to allow user upload file on applet??

    Sorry I'm new to programming here, but I'm trying to allow user to upload a file to the server so the program inside the server can user the file as input.
    I've noticed that JFileChooser, the ideal class for this, is not allowed on the applet, so I don't know how to go about doing this.
    Thanks for any input!

    ok
    you wish to transfer a file from applet to server.
    1. Applet gets the file
    the applet needs to access the file System therefor it must b a signed applet to get aound the security restrictions. This is why the JFileChooser doesn't work. Check out the tutorials on jars and applets, particularly the security notes.
    2. opens a connection with the server
    so the applet has a file and needs to send it. there needs to be a service of some form on the destination computer to execpt the file. Perhaps you write your own perhaps you use HTTP.
    3. server software stores the file
    where an applet is an mini application that runs within the confines of the web browser. a SERVLET is a service program which runs with in the confines of a server, such as a web server.
    this is a lot easier to do HTML rather that applet in my opinion but which ever.

  • Upload http file using applet

    Hello every body,
    I am trying to upload the http file using applet. Can any body give me the hint or example.
    Thanks in advance
    best regards

    any of several libraries are out there that would let you to HTTP File Upload to a web server, assuming the web server has a servlet or other thing to accept the file.
    Of course, where you get the file might be a problem without a signed applet.

  • Can i load a class in subdirectoy  inside a jar file using applet tag?

    hi every one.. thank you for reading ... i am really in dire need for the solution..
    my problem is that i have a jar file contianing a package which inturn contains my applet class...
    i am trying to access this applet class using a applet tag in html file. this html file is in same directory as the jar file. i am having no problems in windows but when i am doing this in linux apache server i was getting class not found exception. (already checked the file permissions). and when i am successful when using simple package directory instead of jar file . so gist of my quesition is "can i load a class in subdirectoy inside a jar file using applet tag in a html file"?

    When you tested in Windows were you using Internet Explorer? On Linux you will be using a different browser, usually Mozilla of some version, or Firefox. Note that the HTML tags for applets will be different between the browsers if you are using the object tag. Principally the classid value for the object tag will differ between Firefox and Internet Explorer.

  • Multiple File Upload Applet

    I am attempting to code a JavaBean wrapped by an applet that will upload multiple files to a web server via the multipart/form-data mime-type.
    I have moved a number of files to the web server with limited success.
    I cannot move more than roughly 30Mbs of files in any configuration without causing a fatal exception.
    I am confident that it is a limitation of the client's VM and the memory allocated to the applet.
    I have seen several commercial grade applets that claim they can move any number of files even totalling 180Mbs.
    My applet is very simple. It opens a JFileChooser dialog box, allowing the user to select multiple files and communicates directly to a server side component that accepts multipart/form-data.
    I am navigating the protocol just fine. It seems to be a memory problem on the client side. Does anyone know how I can defeat this restriction and pass a reasonably high number of files (100-200) ranging from 50Mbs to 180+Mbs?
    Secondly, why does this happen: when I put my files onto the output stream, no files move accros the stream until I call .close(). How can I write the code to begin transferring bytes as soon as I call outputstream.write(xxx)?

    i am also developing multiple file upload applet and i transferred 1,4gb of data (2 files a 700MB) successfully.
    also, i just transferred a few hundred files with total size of 900mb to my localhost webserver (~5000kb/s)
    1) open file
    2) read a few kilobytes into buffer
    3) send them to the server
    4) flush the outputstream (!!)
    5) clear buffer and goto 2)
    6) if end-of-file, close the file and flush again.
    the outputstream is flushed every few kilobytes, so it will be sent over the socket to the server and not buffered until dawn.
    i don't know how the server-side is working, but i used apache/php script.
    you can try out my applet under
    http://www.haller-systemservice.net/jupload/

Maybe you are looking for

  • How can i get back to windows 8 if i downgrade my laptop to windows 7

    My laptop was been downgrade from windows 8 to windows  7because of graphics not funtioning properly. how can i get back to windows 8 again? is there a recovery disc for this?

  • I Pod touch Will not Update Software

    HI, I got an I Pod Touch Model MC540LL (Dont know what Generation it is), Ive tried several times to update software from 4.3.3 to the new 5.0.1? Is that possible? When I try updating using Itunes, the downloading stops and tells me (server reset) I

  • XML Element to string conversion returning null

    Hi, When i try to convert XML Element to string using toString() API, it returns something like [device: null] where device is element tag. Code is as follows - Document xmlDoc; DOMParser parser = (DOMParser)Class.forName("org.apache.xerces.parsers.D

  • Bootcamp.msi ?

    I'm trying to update my Boot Camp drivers to 3.0 with the Snow Leopard install disk, but I keep getting this error in XP: The feature you are trying to use is on a network resource that is unavailable. Click OK to try again, or enter an alternate pat

  • Strange behavior in Webi : No data returned

    Hi, I am experiencing a strange behavior. I have created a condition object in universe. Start Date : DATE_DIM_TBL.DAY >= UPPER(to_char(to_date(@prompt('Enter start date','D',,mono,free),'dd/mm/yyyy HH24:MI:SS'),'dd-mon-yy')) End Date : DATE_DIM_TBL.