Cache Problem while loading PDF in IE

Hi,
I am getting a problem when I load a PDF from my servlet.
I am using the following code.
pdfInputStream = httpURLConnection.getInputStream();
output = aResponse.getOutputStream();
aResponse.setContentType("application/pdf");
byte[] buffer = new byte[1024];
int bytesRead = 0;
while((bytesRead = pdfInputStream.read(buffer, 0, buffer.length)) >0) {
output.write(buffer, 0, bytesRead);
It works fine in Netscape. In IE it gives a problem when the PDF is very small 5KB and less. It does not show the report. When I click reload it shows it then.
When I make the browser cache setting to "Every visit to page". It works fine.
Then I tried to disable the cache for IE using the following code but this does not work in IE.
pdfInputStream = httpURLConnection.getInputStream();
output = aResponse.getOutputStream();
aResponse.setContentType("application/pdf");
aResponse.setHeader("Cache-Control", "no-cache"); //or
aResponse.setHeader("Pragma", "no-cache"); //or
aResponse.setDateHeader("Expires", 0);
byte[] buffer = new byte[1024];
int bytesRead = 0;
while((bytesRead = pdfInputStream.read(buffer, 0, buffer.length)) >0) {
output.write(buffer, 0, bytesRead);
Each of the above methods did not work. IE was not recognising it as pdf any more and showing the save file box.
Anybody have any solutions for this. There was another query of this kind but no answers for that.
Regards,
Ritesh

This is not a cache problem.
With IE you must specify the PDF content length you sent to browser.
So:
You must add aResponse.setContentLength(bytesTotal); where bytesTotal is the length of data sent to browser.

Similar Messages

  • Problem while loading data from ODS to infoobject

    Hi guys,
    I am facing problem while loading data from <b>ODS to infoobject</b>.
    If I load data via PSA it works fine but
    if I load data without PSA its giving error as Duplicate records.
    Do u have any idea why it is so.
    Thanks in advance
    savio

    Hi,
    when you load the data via the PSA, what did you select? Serial or Paralel?
    If you select serial most likely you don't have duplicates within the same datapackage and your load can go through.
    Loading directly in the IObj will happen thefore if you have the same key in two different packages, the "duplicate records" will be raised; you can perhaps flag your IPack with the option "ignore duplicate records" as suggested...
    hope this helps...
    Olivier.

  • Problem while loading applet in opera- very urgent please

    hi,
    I am having problem while loading applet in opera browser. Showing "Applet loading " continuously. I am trying to use URLConnection to read information from applet's own host. I cant find the exact problem what is happening, Since there is no error message in browser Javaconsole.
    If anybody have idea on this please help me. I am in great hurry.
    Thanks in advance.
    Rao. V

    hi this is rao,
    I inserted a lot of System.out statements throughout applet life cycle. But they are not displaying in java console. I think the problem is in Opera-java settings. Since i am new to the opera environment i cant get right solution.
    Please help me if anybody having clear idea on this aspect.
    thanks in advance

  • Problem while loading security information (users/roles) from repository

    Iview have stopped connecting to our MDM, All repositories, all IViews Very strange
    Here is what I see in the logs.... Any ideas? Please if you have seen this before only
    Marty
    com.sap.mdm.extension.MetadataException: Problem while loading security information (users/roles) from repository 'PORTAL_CUSTOMERS'
    at com.sap.mdm.extension.MetadataManager.loadRoleCache(MetadataManager.java:559)
    at com.sap.mdm.extension.MetadataManager.internalGetRoleSet(MetadataManager.java:502)
    at com.sap.mdm.extension.MetadataManager.getRoleSet(MetadataManager.java:471)
    at com.sap.mdm.extension.MetadataManager.createMetadataKey(MetadataManager.java:464)
    at com.sap.mdm.extension.MetadataManager.getRepositorySchema(MetadataManager.java:197)
    at com.sap.mdm.uwl.MdmUwlConnector.createUserSessionContext(MdmUwlConnector.java:1463)
    at com.sap.mdm.uwl.MdmUwlConnector.new_retrieveItems(MdmUwlConnector.java:546)
    at com.sap.mdm.uwl.MdmUwlConnector.getItems(MdmUwlConnector.java:129)
    Caused by: com.sap.mdm.commands.CommandException: com.sap.mdm.net.ConnectionException: java.io.IOException: Unexpected socket read.  Result is -1.
    at com.sap.mdm.security.commands.GetUserListCommand.execute(GetUserListCommand.java:72)
    at com.sap.mdm.extension.MetadataManager.loadRoleCache(MetadataManager.java:526)
    Caused by: com.sap.mdm.net.ConnectionException: java.io.IOException: Unexpected socket read.  Result is -1.
    at com.sap.mdm.internal.protocol.manual.AbstractProtocolCommand.execute(AbstractProtocolCommand.java:102)
    at com.sap.mdm.security.commands.GetUserListCommand.execute(GetUserListCommand.java:69)
    at com.sap.mdm.internal.net.DataSocket.receiveData(DataSocket.java:62)
    at com.sap.mdm.internal.net.ConnectionImpl.readInt(ConnectionImpl.java:497)
    at com.sap.mdm.internal.net.ConnectionImpl.readInt(ConnectionImpl.java:490)
    at com.sap.mdm.internal.net.ConnectionImpl.nextMessage(ConnectionImpl.java:629)
    at com.sap.mdm.internal.net.ConnectionImpl.receiveMessage(ConnectionImpl.java:572)
    at com.sap.mdm.internal.net.ConnectionImpl.send(ConnectionImpl.java:233)
    at com.sap.mdm.internal.protocol.manual.AbstractProtocolCommand.execute(AbstractProtocolCommand.java:99)
    com.sap.mdm.commands.CommandException: com.sap.mdm.net.ConnectionException: java.net.SocketException: There is no process to read data written to a pipe.

    Early this month we upgraded the MDM server to:
    MDM Server version: 5.5.63.57
    And the portal components:
    MDM 5.5 SP06 Technology Patch 3 (Build 5.5.63.57)
    MDM 5.5 SP06 Application Patch 3 (Build 5.5.63.57)
    MDM 5.5 SP06 Java API Patch 3 (Build 5.5.63.57)
    However the issue just began 2 days ago?
    We started intgrating MDM Workflow with UWL and assigned Roles and Iviews to the Universal Worklist Configuration
    It seems the Iviews work for a while and then after some time everything gives up? Very confounding
    And yes we are using standard Iviews (search, Result and detail)
    Thanks
    Edited by: Marty Monroe on Oct 31, 2008 3:07 PM

  • Facing  problem while loading data into XI

    Hi All,
    I am facing a peculiar problem while loading data into XI when we load small amount of data say 5-10 records these records gets processed, but when we try to load a bit higher volume say 100-500 which comes out to be around 7 record s per second then the record processing gets stalled. That is it gives a message that "recorded for outbound processing".
    So can any body throw some light on it and can tell us why we rare facing such problem and how can we resolve that problem.
    Thanks in Advance.
    Regards
    rahul

    Hi rahul,
    Deregistering and Registering the Queue is a temporary solution.
    The better way to this would be to Tune your Xi system as already mentioned by Vijaya as mentioned in the guide ,
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/70ada5ef-0201-0010-1f8b-c935e444b0ad
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/7fdca26e-0601-0010-369d-b3fc87d3a2d9
    Regards,
    Bhavesh

  • (Class cast Exception)Problem while loading data fro database in java class

    Dear all,
    Please help me...to solve this
    I have a database having two columns of String and Date Types.
    In my java code i was trying to load the data to a UI.
    I am successfull in loading the String type value.
    But while loading date field value,is showing Class cast Exception.
    What i am doing is Getting the values from database to a String[] array.
    So my question is how to
    get the Date field as date field itself,Then convert it to a String..Then put it in to String[] array...
    Any body please help...If any one want more clarification in question i will give......

    Hi,
    I am using GWT to display my data in a Grid.
    So it will accept a Single two dimensional String array....Here i have one as String and other as Date.
    So i was trying to get each row in a sindle dimensional array array[] then store it in a list.
    Iteration goes up to 10 rows.After i am setting it in to a list
    ie list.add(array);
    Now while returning this list i am doing this
    "return (String[][])list.toArray(new String[0][]);"
    When i tried to get the date element to String array it is showing class cast exception. When i tried with toString() method it is showing the same problem.

  • Idoc problem while loading

    Hi Gurus,
    I am getting error "<b>Idocs missing: No end-confirmation arrived in the Warehouse from</b>" while loading data from R3 to BW via process chain.
    Can any one please suggest me how solve this problem.
    Thanks in advance.
    Regards
    Tony

    Hi,
    It may be due to below reasons...
    1. Check whether the Log Table is full in the BW side.
    2. Check Whether the Connection to Source System is fine.
    3. System might be busy , Many jobs running in system.
    Go to SM58 in BW system , find TRFC queue with enteries for each LUW . U can come to know why IDOC is not processed by looking at the error there . Also check whether the job is finished successfully in Source System. U can process the LUW in Sm58 manually from Edit menu entry ....
    Thanks
    DSt

  • ALC-WKS-007-027 error while loading PDF form

    Hello,
    I have created a process to load pdf form. When I invoke the process on woekbench, it works.   But when I tried to load it on workspace, the workspace showed
    "An error occured during the opeartion (endpoint id 2601). (ALC-WKS-007-027)"
    The process is look same as sample "render pdf form" process, the only thing I modified is the formUrl, I unchecked the input for formURL and add a pdf url as default value.
    Any idea?

    I also found the error under log file:
    Caused by: com.adobe.idp.taskmanager.dsc.client.TaskManagerServiceException: Orchestrated operation for TaskManager Connector EndPoint point MUST have a Task form-datatype as input.
    at com.adobe.idp.taskmanager.dsc.service.TaskEndpointManagerImpl.invokeEndpoint(TaskEndpoint ManagerImpl.java:440)
    at com.adobe.idp.taskmanager.dsc.service.TaskEndpointManagerImpl.invokeEndpoint(TaskEndpoint ManagerImpl.java:323)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:585)
    at com.adobe.idp.dsc.component.impl.DefaultPOJOInvokerImpl.invoke(DefaultPOJOInvokerImpl.jav a:118)
    ... 82 more
    The process that I created doesn't have a xfaform as input, is this the problem?
    Thanks

  • Problem when loading pdf files from Shared Content

    When I load pdf files from Shared Content, I got the following problem: "The selected document could not be retrieved, please try uploading the document again."
    Anyone knows this?
    Thank you very much in advanced.

    I don't migrated the program, but installed it from the original installer,
    i. e. I first installed Indesign from backup, and then uninstalled it and
    reinstall  clean from Adobe.
    What a plug-in or utility converts page from InDesign to PDF?
    2014-08-10 22:51 GMT+04:00 Peter Spier <[email protected]>:
        problem with exporting PDF files from InDesign CS5  created by Peter
    Spier <https://forums.adobe.com/people/P+Spier> in InDesign - View the
    full discussion <https://forums.adobe.com/message/6627440#6627440>

  • Cache problem when loading modules ?

    Hello Flex friends !
    I am currently experiencing a strange problem. It happens in
    my production environment when using my web browser to access the
    application. Here it is :
    The main application is a menu on the left and a ModuleLoader
    in the center. Regarding the menu's button I click, the
    ModuleLoader will load either ModuleA, ModuleB, etc ... nothing's
    special until then, everything works fine.
    Then I update the ModuleA.swf and Module.swf files. Now when
    I click the menu's button I get the old ModuleA and ModuleB.
    This seems to be a cache problem, no ? I thought the browser
    was going to compare the local ModuleA version and the server
    ModuleA version and then load the server ModuleA version, but it
    does not seem to work this way. So How does it work ? I'd like to
    understand.
    Thanks for your help guys !
    Olivier

    Hi,
    Try this.
    Step 1:  Goto Details, Status get the IDoc number,and go to BD87 in R/3,place the cursor in the RED IDoc entroes in tRFC
    queue thats under outbound processing and click on display the IDOC which is on the menu bar.
    Step 2: In the next screen click on Display tRFC calls (will take you to SM58 particular TRFC call)
    place the cursor on the particular Transaction ID and go to EDIT in the menu bar --> press 'Execute LUW'
    (Display tRFC calls (will take you to SM58 particular TRFC call) ---> select the TrasnID ---> EDIT ---> Execute LUW)
    Rather than going to SM58 and executing LUW directly it is safer to go through BD87 giving the IDOC name as it will take you
    to the particular TRFC request for that Idoc.
    OR
    Directly go to SM58 > Give * / user name or background  (Aleremote) user name and execute. It will show TRFCs to be executed
    for that user. Find the particular TRFC (SM37 > Req name > TID from data packet with sysfail).select the TrasnID (SM58) --->
    EDIT ---> Execute LUW
    Thanks,
    JituK

  • SQL Loader problem while loading records from txt file to database table.

    I am getting following error while loading records from flat txt file into database table with the help of 'sqlldr' command. I have executed catldr.sql from RDBMS folder but it is still showing same error. I am setting DIRECT = TRUE while issuing sqlldr command. If I try with DIRECT = FALSE then it works fine. Database is Oracle 8i.
    SQL*Loader-951: Error calling once/load initialization
    ORA-24329: invalid character set identifier
    F1 Please.

    Hello,
    Direct path load, can only be used with SQL*Loader and Database have the same version.
    Care to tell the database version and sql*loader version you are using.
    -Sri

  • Problem while loading texts and authorization objects file in RAR

    Hi all,
           i am getting internet explorer error while loading the texts and authorization objects text files in RAR .actually we uploaded rule file before this,does this step causes any error ?if so how to resolve this error.do i need to remove all rules/risks and then load text and authorization files? is there any shortcut to renove all risks generated in one shot? please reply me soon to resolve this.
    Thanks,
    Joseph.

    Hi Joseph,
    Please make sure to convert both the files in UTF-8 encoding format and then try to upload the files again. This should resolve the issue and if not then please paste the logs here.
    Regards
    Harleen

  • Problem while loading windows 7 and dual boot

    good evening am getting problems while installing windows 7 and fedora,is this laptop HP 15-R262TU supports only windows 8.1 and it is suppoting dual boot or not? please reply soon
    This question was solved.
    View Solution.

    Hi 
        Here is the link required for all Windows 7 Drivers for your machine ,  Once you have installed Windows 7 goto the link and download all drivers that are not installed via Device manager .  If you make a list of drivers not installed and then refer to the drivers page and take all the drivers you require .
     http://support.hp.com/us-en/drivers/selfservice/HP-15-Notebook-PC-series/7486447/model/7812714#Z7_30...
                                           Checkurtech
    ****Click the White Kudos star to say thanks****
    ****Please mark Accept As Solution if it solves your problem****

  • Error while loading PDF Preset file

    Dear All,
    I am trying to create a PDF of the InDesign Document after my process. For that I load the preset file generate the PDF and unload Preset file from the server. On this it gets removed properly from the temporary folder also.
    Problem is when I run the process second time using the same preset file InDesign Server throws an error "This file is already open by another user or another application. This file may be stored on a network server and cannot be opened until the other user closes it."
    It works only if I restart the server. Can somebody help me on this its urgent.
    Thanks in advance.
    Regards
    Farzana.

    Dear Tom,
       I used your coding, but this is throwing error.
      app.open("myJobOptions.joboptions"); -> your coding.
    here I can pass the Job option file path and file name, see below my coding
    app.open(File("d:\\myJobOptions.joboptions")); -> This is not working.
    Question :
    (*)  I'm having  the joboptions in saparate folder, I can Add that Joboption in my InDesign Application.
    (*) How to Add the JobOption in my InDesign File.
    (*) Use that joboption and export as PDF file.
    See my Coding [this is not working]
    //=================== Coding =====================//
        var myPreset = File("d:\webPDF.joboptions");
         var pdfPreset = app.pdfExportPresets.add(myPreset);
        pdfPreset.name = "First_JOB";
         myFolder = "d:\";
         myBaseName  = "Dummy";
    var myFile= new File(myFolder+"/"+myBaseName +"_web"+ ".pdf");
    var result = "exported to:  " + myFile.fullName;
    if(!myFile.parent.exists && !myFile.parent.create())
      result = "Not exported.  Unable to create the folder:  " + myFile.parent.fullName;
    } else {
      app.documents.item(0).exportFile(ExportFormat.pdfType, myFile);
    //============== End of the Coding =================//
    Please make it corrtect and give me the solution.
    Pls. I'm struggling this part, so Please as soon as possible explain & give the solutions for the above problem.
    Thanks & Regards
    T.R.Harihara SudhaN.,

  • Problem while loading a jar file into database

    Hi All,
    We are using Oracle 8.1.5 in Solaris. When I try to load a jar file into the database by using loadjava it gives the following error
    Error while processing jar cryptix32.jar
    Exception java.io.IOException: Load Java is unable to handle compressed entries: cryptix/provider/Cryptix.class
    loadjava: 1 errors
    Can anybody suggest anything to overcome this. Thanks in advance.

    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by John Emmer ([email protected]):
    I presume you've tried creating the jar w/o compressing it? If not, and even if you didn't create the jar, then first unpack the jar into a directory and re-jar it without using compression.<HR></BLOCKQUOTE>
    Hi John,
    Thanks for your help. I unpacked the jar and rhen re-jared it with -0 (uncompress ) option. The above error is gone. But I am getting another problem. I am getting the following error for all the classes except the property files.
    Error while resolving class cryptix/cryptix/provider/cipher/Rijndael
    ORA-04043: object cryptix/cryptix/provider/cipher/Rijndael does not exist
    But the class is there in the jar. I am able to load single individual classes. Can anybody help me in this matter. Thanks in advance.

Maybe you are looking for

  • Mac mini refuses to recognize existing TM backup set

    I just got my mac mini fixed with a new logic board, and I have it connected to a 250GB external FW drive. Time machine was running on a partition on the external drive quite happily since I bought it in November, but since getting it back from the r

  • Create SQL run by batch -certain record

    hi all , i have created one program , and i have execute more than 40000 record. the problem is, when i run this background job with 40000 record, i got DBIF_RSQL_INVALID_RSQL error. if i run 100 record it will display. how i want to modified my pgra

  • My ipod always cuts off the end of some of my songs when theyre clearly not done... Anyone having the same problem?

    My ipod is a 2nd gen ipod touch and i will go to listen a song and my ipod will cut it off when the song isnt done, like right inn the middle of it and just change to the next song. So frustrating anyway to fix it?

  • [UNSOLVED] multi monitor question

    Is this possible? I have a laptop. right now the lap screen is disabled and I have a 19' LCD hooked to it via a vga port. Is it possible to have 2 seperate logins/wm's on each screen or have my GUI on one screen and have an actual terminal on the oth

  • How do i get Reader to NOT print in booklet form?

    All my print settings are set to print normal, but only adobe reader prints in booklet form.  I've checked the "properties" settings for the printer and the "page layout" is set to 1 page per sheet and booklet is not checked.  On the print dialog scr