Displaying message  in JApplet while downloading a file

hi
In my applet Im trying to download a file from server to client while downloading i want display progressbar/ msg
when i try to do this my applet GUI dosnot loads untill that file download complete and i tried with a button so that ofter clicking on it download should start, in this case also the masg doesnot changes according to given setText method for that Jlabel.while output message to console is printing properly.
even i have tried with generating new thread to set Jlabel text message. that also doesnot worked
here im going to paste my code part of applet could anybody tell me what wrong in my code / else what could be done..?
client machine is windows XP
public void init()
Container Contentpane=getContentPane();
Contentpane.setLayout(null);
textpanel = new JPanel();
textpanel.setLayout(null);
textpanel.setBounds(10,40,250,200);
msg=new JLabel();
msg.setBounds(5,5,200,150);
textpanel.add(msg);
getContentPane().add(textpanel);
public void start()
msg.setText("<html>Downloading File to System...<html>");
URL inFileURL=new URL(getCodeBase()+"/load/My.dll");
System.out.println(" opening connection- ");
URLConnection urlfl=inFileURL.openConnection();
urlfl.setDoInput(true);
urlfl.setDoOutput(true);
urlfl.setUseCaches(false);
urlfl.setRequestProperty("Content-Type", "application/octet-stream");
int sz=urlfl.getContentLength();
System.out.println(" Total Length ... " +sz);
BufferedInputStream inFile1 = new BufferedInputStream (urlfl.getInputStream(),urlfl.getContentLength());
int succesbytes = 0;
int current_read;
byte[] strMsg11 = new byte[urlfl.getContentLength()];
int readrs;
BufferedOutputStream outfl =new BufferedOutputStream(new FileOutputStream("c:\\My.dll"));
while(inFile1.available() > 0)
current_read =inFile1.read(strMsg11,0,urlfl.getContentLength());
System.out.println(" Current Read = "+current_read);
succesbytes += current_read;
outfl.write(strMsg11,0,current_read);
msg.setText("<html>"+successbytes+" bytes downloaded successfully..<html>");
System.out.println("Written ... = " +succesbytes );
outfl.flush();
outfl.close();
} //end of start
thanks in advance
Edited by: Hegde on Oct 6, 2007 6:48 AM

Hi Vic,
Please post in ASP.NET forums.
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click
HERE to participate the survey.

Similar Messages

  • Error While downloading the file A server Error has occurred, please try again later Downloading Yahoo mail Application Attachments  Trying to download My Photos and movie 3 items so i can delete them all

    I have icloud and a new iPhone5 ! They work good , took pictures and a few short movies, plugged in my phone to my iMac transfered Items to iPhoto then inported items to iMovie. when getting to know what i was doing i decided to delete pictures and movies i no longer wanted. when i looked for a few missing items i opend Finder and there some where buyt i had already trashed them and deleted the doubles. Still could not find missing pictures and movies 3 items and today after calling yahoo about a different complant with sending feed back for Yahoo mail Applications login . i opened up Attachments Not the Large Attachments just Attachments and there were the 3 items i had been hunting for to Trash and delete. the mail Attachments file does not have the Option to delet Files and photos and movies. When i tried to Download the 3 items a window shows up that says Error While Downloading the Files, A Server Error has occured, please Try Again later. nothing works how do i remove the Trapped photo and movie Blank Files and trash them?  Onece they get into my downloads i can do something with them as i understand.    That part of it kind of keeps me in Question also because why should i have to down load my own files of Attachments / Pictures and movies if they are comming from my iMac?    How much better is iLife11 then iPhoto08 and iMovie08 .  Thanks Greg

    Hello,
    Thank you for your post.
    This is a quick note to let you know that we are performing research on this issue.
    If you have feedback for TechNet Subscriber Support, contact
    [email protected]
    Simon Wu
    TechNet Community Support

  • Firefox crashes whenever i want to install any addon or download any file. Some times i am receiving error while downloading any file like "could not be saved, because you cannot change the contents of that folder"

    I am the user of latest firefox 3.6.6 browser. I am getting problems of frequent crashes whenever i tries to install any addon. The crashes also occures whenever i want to download any file.
    I am also receiving errors while downloading any file like:
    "C:\Users\****\AppData\Local\Temp\******.001.part could not be saved, because you cannot change the contents of that folder.
    Change the folder properties and try again, or try saving in a different location. I already changed it many many times but still the same problem."
    Adobe flash palyer is also giving problems of not responding. I am using updated version of it already. Java is also updated.
    I already uninstalled firefox compeletly and re installed it many many times but still the same problem. I also scanned my computer with avira and malware bytes' Anti malware and got no dection. Please ractify this problem ASAP lest my profession will suffer.
    == Crash ID(s) ==
    b7f518f2-8d86-41ca-8bab-aee632100709; 1d790e10-d8eb-4904-98c9-94bc62100708; f042d319-b9f8-42ed-a8cb-57c7d2100708

    Please help.
    It is getting worse
    Adobe flash player is crashing. I already uninstalled and re installed the latest ver. Also it is hanging randomly.
    Please help.

  • I am getting the following message "safari could not download the file (440MB) because there is not enough disk space.  disk utility says i have 249.8 GB of available disk space.  any suggestions as to what is the problem would be appreciated

    i am getting the following message "safari could not download the file (440 MB) because there is not enough disk space.  please delete files or download to another disk."  when i check system information it tells me i have 249.82 GB of disk space available.  any suggestions as to what i can do to resolve this problem.

    don
    thanks for your suggestion.  that is the same advice that i got from the geek squad at the local apple store.
    i did what he instructed but it did not work.  i have since called apple support twice regarding the problem.  they had me start the computer in safe mode, going into the library and deleting a phlist file (i think) do a repair disk permissions, do a repair disk, empty the cache, and finally the last guy told me to unplug the computer from the wall socket and restart.
    when i mentioned the advice you and the apple store guy gave me they sort of poo pooed it saying that was done when they did all this other stuff.
    i am now waiting for the download to be completed to see if unplugging the computer had any effect.
    thanks again for your kindness in answering my concern.

  • Help!  How do I download software for a HP Laserjet Professional P1100? I keep getting the same message when I have downloaded the file "Your security preferences allow installation of only apps from the Mac App Store and identified developers" Help!

    How do I download software for a HP Laserjet Professional P1100? I keep getting the same message when I have downloaded the file "Your security preferences allow installation of only apps from the Mac App Store and identified developers" Help!

    You can change the settings in Security & Privacy to "Anywhere"...
    That should work... as to whether the printer driver will work, that's another question.
    Good luck,
    Clinton

  • Has anyone ever got the message error occurred while converting the file - you do not have the privilege to make changes - when importing cps?

    Has anyone ever got the message error occurred while converting the file - you do not have the privilege to make changes - when importing cds?

    Hey amba1015,
    I found an article that talks about similar error messages in relation to importing an audio CD. Check out the recommended troubleshooting steps in here to see if they help:
    Trouble adding music to iTunes library or importing audio CD
    http://support.apple.com/kb/TS1387
    Welcome to Apple Support Communities!
    Have a good one,
    Delgadoh

  • Can I leave the display open for say all day while downloading torrent file

    Sometimes it takes all day to download a torrent file can i leave the display on or should i turn it off and will my macbook keep downloading the file thank you

    It's fine to leave it on but you can also just set the display to go to sleep and let your computer keep working. The settings are under *System Preferences* in *Energy Saver*. I usually have mine turn off after 15 minutes so it will rest while my download or other work continues.

  • Error while downloading a file via APEX screen

    While I try to download a file using the below code;
    an HTTP 404 error is coming although the proc is being called and the parameter is correctly being passed.
    Please help.
    create or replace procedure download_myfile1(p_id in number)
    as
    v_mime varchar2(255);
    v_length number;
    v_file_name varchar2(2000);
    Lob_loc BLOB;
    BEGIN
    -- -- Selecting the details from the table whoch contains the extracts
    select EXTRACT_FILE,FILE_NAME,dbms_lob.getlength(EXTRACT_FILE) into lob_loc,v_file_name,v_length from table_name where ID = p_id;
    -- -- set up HTTP header
    -- -- use an NVL around the mime type and
    -- if it is a null set it to application/octect
    -- application/octect may launch a download window from windows
    owa_util.mime_header( 'application/octet', FALSE );
    -- set the size so the browser knows how much to download
    --v_file_name := substr(v_file_name,1,instr(v_file_name,'.')-1);
    htp.p('Content-length: ' || v_length);
    -- the filename will be used by the browser if the users does a save as
    htp.p('Content-Disposition: attachment; filename="'||v_file_name|| '"');
    -- close the headers
    owa_util.http_header_close;
    -- download the BLOB
    wpg_docload.download_file( lob_loc );
    end download_myfile1;
    It shows a POP up window by which u can save or opens the file. But no pop up displayed in this case.
    -Shreya

    Hi,
    Made the same changes but still getting the same error.
    The earlier URL also that I had mentoned would dynamically make this url mentioned by you and then shows the pop up window.
    However when I am right clicking on the download link and then clicking 'Save target as' then this error message is provided:
    Internet Cannot download [schema name].download_myfile2 from [DNS name]
    Internet Explorer was not able to open this Internet Site.The requested site is either unavailable or cannot be found .Please try again.
    Please help..
    Thanks in Advance ...
    Shreya
    Edited by: 935203 on Jul 9, 2012 11:58 PM

  • Display save as dialog when downloading a file

    Hi,
    I want to display a save as dialog when the user downloads a file.
    Now I get a dialog where the user can choose to open or save it.
    I set these headers:
    res.setHeader("Content-disposition", "attachment; filename=" + filnamn);
    res.addHeader("Content-Type", "application/force-download");Thanks!

    Sorry!
    When the user downloads a file I want to open a dialog where the user
    can write a filename and then click Save to save the file.
    Today I get a dialog where the user first have to choose if he wants to open or save the file.
    When he clicks save then the dialog appears that I would want to be displayed.
    I hope this clearifies my question.

  • Error while downloading PDF file from FTP Server

    Hi Friends,
    I have sent a PDF file with data to FTP , Then i want to check that uploaded pdf file , whether that is correct or not?
    for that , i have downloaded that file from FTP and i am trying to open the file . but it is giving this problem .
    "There was an error opening the document . The file is damaged and could not be repaired."
    will you suggest me regarding this.
    thanks in advance.
    balaji.T.

    CALL FUNCTION 'CONVERT_OTFSPOOLJOB_2_PDF'
              EXPORTING
           SRC_SPOOLID                    = spoolno
                src_spoolid                    = wa_file-rqident
                no_dialog                      = ' '
          DST_DEVICE                     =
          PDF_DESTINATION                =
              IMPORTING
                pdf_bytecount                  = numbytes
                pdf_spoolid                    = pdfspoolid
          OTF_PAGECOUNT                  =
                btc_jobname                    = jobname
                btc_jobcount                   = jobcount
              TABLES
                pdf                            = pdf
              EXCEPTIONS
                err_no_otf_spooljob            = 1
                err_no_spooljob                = 2
                err_no_permission              = 3
                err_conv_not_possible          = 4
                err_bad_dstdevice              = 5
                user_cancelled                 = 6
                err_spoolerror                 = 7
                err_temseerror                 = 8
                err_btcjob_open_failed         = 9
                err_btcjob_submit_failed       = 10
                err_btcjob_close_failed        = 11.
    because of this one PDF internal table is obtained.
           OPEN DATASET L_FILENAME  FOR OUTPUT in text mode  MESSAGE MSG.
      LOOP AT pdf.
        CONCATENATE pdf-tdformat       "Material group
                     pdf-TDLINE       "Basic Material
               INTO ITEXT-TLINE ..
        APPEND ITEXT.
        TRANSFER ITEXT TO L_FILENAME.
      ENDLOOP.

  • Error while downloading a file

    I have written a servlet that downloads a file from my server on to my mobile.
    i have written the following code to download the file:
    URL url = new URL(path);
                        URLConnection connection = url.openConnection();
                        InputStream stream = connection.getInputStream();
                        BufferedInputStream in = new BufferedInputStream(stream);
                        FileOutputStream fos = new FileOutputStream(fileName);
                        BufferedOutputStream out = new BufferedOutputStream(fos);
                        int i;
                        while ((i = in.read()) != -1)
                            //System.out.println("Reading the file");
                            out.write(i);
                        out.flush();The code has no errors, but i m unable to download the file. The mobile gives me an error saying:
    Services: Empty File
    Can anyone please help me out with this problem.
    with regards,
    Shirish

    This way to download files from server looks odd. You're issuing a new URL connection, likely to self. This may be slower than accessing the file directly using FileInputStream.
    But anyway, you haven't set the contenttype and contentlength accordingly. Likely the mobile is aborting the download immediately since the headers have sent a contentlength of 0 bytes.
    Check at the bottom of http://balusc.xs4all.nl/srv/dev-jep-pdf.html for some downloadFile() snippets, which might provide useful insights how to download files.

  • Getting Exception in JWS while downloading jar files from server

    Hi All,
    I am running JWS on j2re1.4.2_10(build 03). while JWS is trying to download jar files from web server, I am getting the following Exception.
    All the jar files are signed. Any idea ?
    JNLPException[category: Download Error : Exception: null : LaunchDesc: null ]
         at com.sun.javaws.cache.DownloadProtocol.doDownload(Unknown Source)
         at com.sun.javaws.cache.DownloadProtocol.getDownloadSize(Unknown Source)
         at com.sun.javaws.LaunchDownload.downloadJarFiles(Unknown Source)
         at com.sun.javaws.LaunchDownload.downloadEagerorAll(Unknown Source)
         at com.sun.javaws.Launcher.downloadResources(Unknown Source)
         at com.sun.javaws.Launcher.handleApplicationDesc(Unknown Source)
         at com.sun.javaws.Launcher.handleLaunchFile(Unknown Source)
         at com.sun.javaws.Launcher.run(Unknown Source)
         at java.lang.Thread.run(Unknown Source)

    Are you able to download your *.jar files directly from server
    For example say,
    http://127.0.0.1:8080/test/testme.jarIf yes,
    Then problem should be with your *.jnlp file. Check all your *.jar with respect to context location of your url from where you are downloading *.jnlp file

  • "\n" problem while downloading the file in unix environment

    Hi folks,
    I have some problem in uploading and downloading the file in unix environment..
    This is my sample code i am using.
    File userDataFile = new File("xyz".csv");
    out = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(userDataFile),"UNICODE"));
    out.write("Name"+"\t");
    out.write("Age"+"\t");
    out.write("Dob"+"\t");
    out.write("Contact"+"\n");
    for(int i=0;i<retList.size;i++){
    out.write("xyz"+"\t");
    out.write("22"+"\t");
    out.write("300399"+"\t");
    out.write("xyzzz"+"\n");
    as per this i wrote code for generating the reports. Its contains some 7k records.
    Its works in Windows environment.
    Some times in Windows environment if the contents size is 7000 records means
    i got only the headers..
    I am not getting any real records.
    I am not sure.. my client is using may be an unix environment..
    Please give the solutions for this..
    Very thanks in advance.

    Hi Jothi,
    This is not an answer to your question. It is a question for you instead. I have tried to reach you on several forums regarding the HAP_DOCUMENT documentation you have.
    Again, I am really sorry to contact you through a differente forum, but I really need the HAP_DOCUMENT documentation for my project.
    Please send me a message to [email protected]
    Thanks again.
    JULIAN CASTRO

  • Mozilla should always give open with option while downloading any file

    in Mozilla, when i click on the file to download the dialog box comes with the options of either opening it or saving it. say i get open with option when i click it, if i toggle to save it and go ahead with that process. Mozilla is remembering the last event, and showing me save it option selected when i click on download that file. i would want to set the mozilla config to have open with option selected for any kind of download in my browser. how to do this?

    yes this is a way to keep giving me "open with" option for that type of the file. but still if user clicks save option. next time it will show save option clicked while downloading. am not sure if i have put the query correctly. is the problem statement clear?
    the reason i want this is because my script which is automated script for an application, when download is clicked i want the open option to be enabled so that i just do a key down option. if it is going to be different everytime. i cant use this script.

  • Inserting Field Names as Header while downloading the file

    Hi,
    I am downloading one file using CALL METHOD cl_gui_frontend_services=>gui_download and wanted to add field names as header while downloading.I have the filed names in one internal table and have written the code as follows:
       LOOP AT gt_import INTO gw_import.
          gw_fldname-field_name = gw_import-field_name.
          APPEND gw_fldname TO gt_fldname.
        ENDLOOP.
    Here gt_fldname has the field names.
          l_descr_ref ?= cl_abap_typedescr=>describe_by_data( gt_fldname ).
          CLEAR : l_counter.
          LOOP AT l_descr_ref->components[] ASSIGNING <lfs_comp_wa>.
            l_counter = l_counter + 1.
            ASSIGN COMPONENT sy-index OF STRUCTURE gt_fldname TO <lfs_comp>.
            IF sy-subrc = 0.
              <lfs_comp> = <lfs_comp_wa>-name.
            ENDIF.
          ENDLOOP.
       CALL METHOD cl_gui_frontend_services=>gui_download
          EXPORTING
            filename                = pdir1
            filetype                = text-038
            append                  = ''
            write_field_separator   = 'X'
          CHANGING
            data_tab                = <lfs_comp>
          EXCEPTIONS
            file_write_error        = 1
            no_batch                = 2
            gui_refuse_filetransfer = 3
            invalid_type            = 4
            no_authority            = 5
            unknown_error           = 6
            header_not_allowed      = 7
            separator_not_allowed   = 8
            filesize_not_allowed    = 9
            header_too_long         = 10
            dp_error_create         = 11
            dp_error_send           = 12
            dp_error_write          = 13
            unknown_dp_error        = 14
            access_denied           = 15
            dp_out_of_memory        = 16
            disk_full               = 17
            dp_timeout              = 18
            file_not_found          = 19
            dataprovider_exception  = 20
            control_flush_error     = 21
            not_supported_by_gui    = 22
            error_no_gui            = 23
            OTHERS                  = 24.
        IF sy-subrc <> 0.
          EXIT.
        ENDIF.
        CALL METHOD cl_gui_frontend_services=>gui_download
          EXPORTING
            filename                = pdir1
            filetype                = text-038
            append                  = 'X'
            write_field_separator   = 'X'
          CHANGING
            data_tab                = <gfs_table1>
          EXCEPTIONS
            file_write_error        = 1
            no_batch                = 2
            gui_refuse_filetransfer = 3
            invalid_type            = 4
            no_authority            = 5
            unknown_error           = 6
            header_not_allowed      = 7
            separator_not_allowed   = 8
            filesize_not_allowed    = 9
            header_too_long         = 10
            dp_error_create         = 11
            dp_error_send           = 12
            dp_error_write          = 13
            unknown_dp_error        = 14
            access_denied           = 15
            dp_out_of_memory        = 16
            disk_full               = 17
            dp_timeout              = 18
            file_not_found          = 19
            dataprovider_exception  = 20
            control_flush_error     = 21
            not_supported_by_gui    = 22
            error_no_gui            = 23
            OTHERS                  = 24.
        IF sy-subrc <> 0.
          EXIT.
        ENDIF.
    But it goes to dump at       l_descr_ref ?= cl_abap_typedescr=>describe_by_data( gt_fldname ) where I am trying to make the filed names horizontal.
    Can anyone help on this?

    The issue has been resolved after writting:
          l_ref_table ?= cl_abap_tabledescr=>describe_by_data( gt_fldname ).
          l_descr_ref ?= l_ref_table->get_table_line_type( ).
    Thanks.

Maybe you are looking for

  • How do I change the default settings for opening documents on my macbook?

    Hi I would like to know how to change the default settings for opening documents on my macbook. Everytime I try to open a doc. it automatically opens with Textedit, instead of Pages or another program.

  • Component video codec

    okay awhile back i asked about why the quality setting couldn't be adjusted for the component video codec...not truly answered though i appreciate dick napoli for jumping in...anyway now it's just gone! no component video codec at all. anything else

  • Copy BSP balance score card

    Hi, when I copy the standard BSP balance score card I get errors in my java scripts. Has someone already tried to copy the balance score card and solve the java script errors. I have a custome who want to use SEM in a portal, with there own portal de

  • Space above unordered list - can't get rid of it

    Does anyone know how to get rid of the space that is added above my text every time I make it an ul? I have set padding and space above to "0", but no luck. Any help? The footer is the problem: http://www.creativestormdesign.com/eSafe/index.html The

  • Text not translating into another language

    Hi! When I'm working in Robohelp HTML, and I select topic langauge and change to another language, it does not change the text. I've even tried just selecting a paragraph and changing the language there, but still nothing happens. I'm not sure if som