UrlEncode a stream or a Document

Hi,
I am trying to POST an xml document as form data. So, I build a org.w3c.dom.Document and want to post it. The problem is that I have to send it as
conn.setRequestProperty("Content-Type", "application/x-www-form-urlencoded")
Now, I could of course convert the Document to a String and then use URLEncoder.encode but I would rather just URLEncode a Stream if this is somehow possible.
TransformerFactory tf =  TransformerFactory.newInstance();
Transformer transformer = tf.newTransformer();
transformer.setOutputProperty(OutputKeys.INDENT, "yes");
transformer.setOutputProperty(OutputKeys.METHOD, "xml");    
transformer.setOutputProperty(OutputKeys.MEDIA_TYPE, "text/xml");
transformer.transform(new DOMSource(doc), new StreamResult(out));where out is:
URLConnection conn = null;
conn.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");
conn.setDoOutput(true);
conn.setDoInput(true);
OutputStream out = conn.getOutputStream();So, is there a way to URLEncode a whole XML Document (doc) or a Stream (out)?
thanks,
dometz

The "Open Finder Items" action will launch the application and open the document. Note that a user can just close the application or document, or push the window aside. If you are wanting to have a user accept your terms before they are logged in, a login hook running a shell script might be the way to go.

Similar Messages

  • How to load a base64-stream (always WORD-document) in large XML files ( 1 MB) into ORACLE 10 table

    On our Oracle Server there are multipe XML files that I have to read and put the data into an ORACLE 10 table.
    I have to threath these XML files one by one.
    In the XML there is also een base64-stream (alwasys a WORD-document) .  This base64-stream exists of 1.000.000 characters.
    How can I read this base64-stream from the XML-file into a BLOB-column of my ORACLE 10 table
    ORACLE 10
    1 XML = +/- 1 MB
    PL/SQL
    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <slo xmlns="http://www.myschema.com/gasdedectie">
    <LekKey>1999_036371_509627</LekKey>
    <HuiNum>46</HuiNum>
    <Res></Res>
    <InfLig>TEST STRUI AFGESTORVEN - PLAANSTRAAT 46</InfLig>
    <XWGS>3.637028</XWGS>
    <YWGS>50.962667</YWGS>
    <Pei>KESTENS</Pei>
    <DatPei>1999-11-30T10:17:36.000+01:00</DatPei>
    <Kan> </Kan>
    <Doc>UEsDBBQABgAIAAAAIQB5g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val+viUlHBI73j
    +IHGhDeabyyD6Mp04mSYVxMdVW+POqCjCaqMQ/3RDeDi6TR2vNC1lAB6Em4Wuii1GpazWAJHSZpgWAKn
    4JZuLR3fBNUF715fuYGxtgqGuNoeeNn0BcsFDsM9zXWDTAbj4GohupBX8Lacq11e0h79i1gR3oRB7CAF
    2LgtvhYF3pdrI3C3nl+8Ds/Ith1byddPRc2ho/I3j1dPpwWhM7LjB2RDLdIWkRYuH1LGT0SeojnOaVq7
    BFkuA9pQVAMYY0BTaIIgWPrYHsu2LSORikcRSzichueAnYjD+b/6XeszqEoPbGTBCzCOSnSFRI0EC1pI
    Gm/rluUi03oFF4vnjF5aR21wjFoE4ogETLvJW3W80oEOio82EcTnwTB/XRsXOtAPhCXIpcXHITQJdWYu
    geHNS+V/b6n3miJqiXa1jR7rvNcbEDpGso0s6GQ4uoH/j9WCo29gxzk1P1Uc6KeCNLDi2GXQvUWPwV1U
    9rG74F3Er+MrGqpL0TuPuXt1eymKgmxpaSaMy4Lp51QwdHpWDd11wprjuoh76PgqurE8HY3RqGnCvMaA
    6VgCeiuMHD9B3ajdxJGhQrcWx0lkJcYSXbaByvE6Bg+dbuRF3pWCKhCDqrzSs25gAmFtmwTAbe1mZ0ce
    +gtG+cFg125gAL00eqC809thFCd1K/Cu0AE0AiqaU9fSToyqDI+eHkGF+QFqfN4U17/KvlxzNEnnL9y7
    4zmJFV25DiiXCo5+BR8Qn0Fz5y8nmuMWx1CA60M5p4YeD+E0L/w42JCE3j+H41t1jI5vbrU0HIPEwD+g
    1x+aMnQ9+TocDQZSry13B8MrnlfFOj9AFJKcDryLbBN68o3GsEywVJU6mUkFVA5+vJQTKYwS6HSoj2vZ
    wGOSZEn0uO0Ayz
    pQQAALNCCQAAAA==</Doc>
    </slo>

    If I understand your question correctly, the discussion in this thread
    ORA-31167: 64k size limit for XML node
    shows you do not have a lot of options.
    As you are needing to extract the contents of a node from an XML document, and that node is > 64K, you are going to need to treat the entire XML as a CLOB and use CLOB functionality (aka INSTR, SUBSTR) to find and extract what you need.
    Once your DB version is 11.1 or greater, then you can use the built-in that Billy mentions.
    Note: mdrake is Mark Drake from Oracle.

  • Is there a way to use a statically defined appearance stream in a dynamically created annotation?

    Hello,
    I want to create a document with cascading 'popups'.  Not the built-in text-only popup, but an annotation containing an appearance stream that defines text and images.  I'm currently using widget annotations based on a pushbutton field.
    Each page in my document has many citations that refer to other pages in the document.  When a user hovers over the citation, I want a 'popup' to appear containing a depiction of the destination.  However, as the destination will itself have citations, I also want the 'popup' to contain citations that the user can hover over, triggering another popup, etc.  In this way, a user could navigate throughout the document without leaving the page or even clicking the mouse.
    Obviously, with even a modest number of citations per page, pre-calculating and statically defining all of these widgets causes a combinatorial explosion, making the document sluggish and very large.
    Instead, I'd like to statically define appearance streams once per document, and then dynamically create annotations and assign the appropriate appearance stream using JS as the user navigates.
    So far I've created a named AP in the names dictionary, but I haven't been able to use it to dynamically set an appearance stream of a dynamically created widget annotation.
    Also, I've called Doc.getIcon(), passing in the named AP, which returns an Icon object.  However, after field.buttonSetIcon() and passing in the named AP, the button does not display the icon.
    Is there a way to use a statically defined appearance stream in a dynamically created annotation?
    Thank you,
    Dave

    Hi George, I've gotten named APs to work, and I expect hidden buttons will follow.  Thank you very much!
    Quick follow-up - I will have many documents embedded within the same pdf file, and some of these documents will contain identical popups.  However, I don't want to store identical icons in each document on account of file size.
    Instead, I'd like to store one instance of each icon for all documents in the file.
    Can I store all of the icons in a single document, and then access them by calling <DocName>.getField().getIcon() from any document in the file?
    Thank you again,
    Dave

  • XML Document to String - Line Separator problem

    I�m facing a problem with line separator while converting a Document object to String.
    Scenario: I get an input XML having line separator say \n (hex: 0A).
    When I create the output XML using Transformer, the line separator is still \n.
    I have a requirement which makes me convert the transformed Stream into a Document.
    When I try to get the String/bytes from the Document, my line separator is now �\r\n�(hex 0D0A), which is my system�s System property �line-separator�.
    I want to keep the line separator same as that was in input string. So, if the input has the separator has \n, output should have the separator as �\n� and if the input has it as �\r\n�, output should have the same.
    i.e. my hex output should match the hex input.
    Any pointers in the direction are welcome.
    Thanks in advance.

    Can I infer that the parser has changed my document
    line separators when I load it into a Document?
    If yes, is there a way to prevent that from
    happening?I don't really know. Since the XML recommendation says that a parser "MUST" do line-break normalization, I would expect that it does. And I wouldn't design systems that use specific non-XML-approved line endings as a feature, either.

  • @MTOM with @SchemaValidation causes IllegalStateException when streaming

    We are using Weblogic-10.3.3 and streaming documents from Documentum to web service clients via MTOM (using the @MTOM annotation).
    Our service was working fine when our EJB web service class only had the @MTOM annotation on it.
    However, adding @SchemaValidation annotation causes a "java.lang.IllegalStateException: closed" exception (AdminServer.log stack trace is below) when the web service response is being returned (to the client).
    In soapUI, the document's content type comes through, but the file size is 0.
    Somehow, @SchemaValidation logic is interfering with the MTOM streaming.
    Has anyone else encountered there and/or know the reason why this occurring? Is the schema validation reading the response stream first (to do its validation) and then, when the client tries to read the same response stream for the document content, there is no data in the stream (since it was read already by the schema validation)?
    Again, there is no problem when the @SchemaValidation annotation is not present.
    Thank you.
    java.lang.IllegalStateException: closed
         at com.documentum.fc.client.content.impl.BlockPuller.verifyOpen(BlockPuller.java:64)
         at com.documentum.fc.client.content.impl.BlockPuller.close(BlockPuller.java:69)
         at com.documentum.fc.client.content.impl.PullerInputStream.close(PullerInputStream.java:110)
         at com.documentum.fc.impl.util.io.InputStreamHandle.close(InputStreamHandle.java:45)
         at java.io.FilterInputStream.close(FilterInputStream.java:156)
         at javax.activation.DataHandler.writeTo(DataHandler.java:297)
         at com.sun.xml.ws.encoding.MtomCodec$ByteArrayBuffer.write(MtomCodec.java:206)
         at com.sun.xml.ws.encoding.MtomCodec.encode(MtomCodec.java:173)
         at com.sun.xml.ws.encoding.SOAPBindingCodec.encode(SOAPBindingCodec.java:258)
         at com.sun.xml.ws.transport.http.HttpAdapter.encodePacket(HttpAdapter.java:368)
         at com.sun.xml.ws.transport.http.HttpAdapter.access$100(HttpAdapter.java:102)
         at com.sun.xml.ws.transport.http.HttpAdapter$HttpToolkit.handle(HttpAdapter.java:534)
         at com.sun.xml.ws.transport.http.HttpAdapter.handle(HttpAdapter.java:255)
         at com.sun.xml.ws.transport.http.servlet.ServletAdapter.handle(ServletAdapter.java:141)
         at weblogic.wsee.jaxws.WLSServletAdapter.handle(WLSServletAdapter.java:210)
         at weblogic.wsee.jaxws.HttpServletAdapter$AuthorizedInvoke.run(HttpServletAdapter.java:311)
         at weblogic.wsee.jaxws.HttpServletAdapter.post(HttpServletAdapter.java:223)
         at weblogic.wsee.jaxws.JAXWSServlet.doPost(JAXWSServlet.java:124)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
         at weblogic.wsee.jaxws.JAXWSServlet.service(JAXWSServlet.java:79)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:821)
         at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
         at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
         at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:300)
         at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:184)
         at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.doIt(WebAppServletContext.java:3686)
         at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3650)
         at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
         at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
         at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2268)
         at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2174)
         at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1446)
         at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
         at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)

    Hi,
    Have you found a resolution to this issue? If you havent, I know why you are getting those issues. Let me know if you are still resolving this.
    regards,
    Johnny

  • JAXB masrhal - URLEncoded?

    I am using JAXB to convert Java Objects to XML, which I wish to post to a URL. However, I cannot see an easy way to URLEncode the stream, so that the resulting XML data gets converted to HTTP compliant characters, Ie < becomes %3C, etc.
    Has anyone done this in an elegant way? Before I marshal to a StringWriter, convert to a String and call URLEncoder.encode() on it?
    Thanks in Advance!
    Steve Rogers

    Here is How I accomplished this:
          Marshaller lMarshaller = mContext.createMarshaller();
          lMarshaller.setProperty("jaxb.formatted.output", new Boolean(true)); // format output with indentation
          ValidationEventCollector lEvents = new ValidationEventCollector();
          lMarshaller.setEventHandler(lEvents);
          // if the content tree does not pass validation, do not marshal, and return events
          List lErrors = validateTree(pContentTree);
          if (lErrors.size() > 0)
             return lErrors;
          StringWriter lSW = new StringWriter();
          lMarshaller.marshal(pContentTree, lSW);
          lSW.close();
          pStream.write(URLEncoder.encode(lSW.toString())); // where pStream is Writer created on HttpURLConnection.getOutputStream()

  • Io exception - cannot close same stream twice

    Hi.
    Hoping someone can help with this problem. I have a JSP page which is receiving an XML request. Currently I pass the InputStream onto another class (whose source I do not have access to and cannot modify) and this parses the stream and creates a document (and I believe in doing so this closes the stream...is that correct?).
    Problem is that now I have to change this JSP page because I need to determine the value of a tag within the XML request before I decide whether to call this class or not. I thought I'd create parse the stream into a document and then reference the node that way. I was able to do this and read the value of that node, but then when I called the class it threw the exception.
    So basically I need another way to read the tag from the XML request without closing the stream down. I read some other posts that talked about creating a StringReader and using that, but wouldn't that close the input stream? I also read about using the mark() and reset() methods, but markSupported() returns "false" so I don't think I can use those.
    Any ideas will be much appreciated.

    Ok, I've tried implemented the solution you suggested but have one problem. I cannot determine the length of the request so I don't know what length to initialise the byte array with. I thought I could use the available() method but this always returns 0. Here is my code (the request is a ServletRequest)...
    ServletInputStream sis = request.getInputStream();
    int numOfBytes = sis.available();
    System.out.println( sis.available() ); //debug
    byte b[] = new byte[numOfBytes];
    String resultVal = "";
    sis.read( b );
    ByteArrayInputStream bais = new ByteArrayInputStream( b );
    bais.mark( numOfBytes );
    // Check whether it is good or bad result
    DocumentBuilderFactory dbf=DocumentBuilderFactory.newInstance();
    DocumentBuilder db=dbf.newDocumentBuilder();
    Document doc=db.parse(bais);
    NodeList resultNode = doc.getElementsByTagName("result");
    resultVal = resultNode.item(0).getFirstChild().getNodeValue();
    // Test whether stream can be re-used
    bais.reset();
    DocumentBuilderFactory dbf2=DocumentBuilderFactory.newInstance();
    DocumentBuilder db2=dbf2.newDocumentBuilder();
    Document doc2=db2.parse(bais);
    if( resultVal.equalsIgnoreCase( "success" ) )
    System.out.println( "success!");
    else
    System.out.println( "not success!");
    //more code to call other class with inputstream which parses it into a document
    Is there another way I can create the ByteArrayStream? or determine the length of the request?

  • Output/Input Streams Cannot Resolve Symbol..

    It is missing something, how do I declare the below 2 variables?
         //Get streams to send and receive data
         private void getSockStreams() throws IOException {
              //Set up output streams for objects
              output = new ObjectOutputStream(connection.getOutputStream());
              output.flush(); //Flush output buffer to send header information.
              //Set up input stream for objects.
              input = new ObjectInputStream(connection.getInputStream());
              displayMessage("Got I/O Streams");
         }Error:
    C:\Documents and Settings\Moon\My Documents\Navi Projects\School\OOPJ Project\Prototype\GPS-Lite v2 Alpha Debugger\appinterface.java:74: cannot resolve symbol
    symbol  : variable output
    location: class appinterface
                    output = new ObjectOutputStream(connection.getOutputStream());
                    ^
    C:\Documents and Settings\Moon\My Documents\Navi Projects\School\OOPJ Project\Prototype\GPS-Lite v2 Alpha Debugger\appinterface.java:75: cannot resolve symbol
    symbol  : variable output
    location: class appinterface
                    output.flush(); //Flush output buffer to send header information.
                    ^
    C:\Documents and Settings\Moon\My Documents\Navi Projects\School\OOPJ Project\Prototype\GPS-Lite v2 Alpha Debugger\appinterface.java:78: cannot resolve symbol
    symbol  : variable input
    location: class appinterface
                    input = new ObjectInputStream(connection.getInputStream());
                    ^
    3 errors
    Process completed.

    Same way you declare any variables in Java:ObjectOutputSream output;
    output = ....
    OR
    ObjectOutputStream output = ...

  • Streams in axis2

    I am writing a webservice wrapper on the top of media server developed in java to enable other language application can use it.
    For the sake of Streaming i used the MTOM with AXIS2.
    I'm unable to stream very big documents until i enable the following parameters in axis.xml
    <parameter name="enableMTOM">true</parameter>
    <parameter name="cacheAttachments">true</parameter>
    <parameter name="attachmentDIR">c:/tmp/</parameter>
    <parameter name="sizeThreshold">4000</parameter>
    But the problem is that is is storing the whole stream in the server at the give place (c:/tmp).
    Instead i want the Inputstream streamed to streaming sever.
    If i remove the last 3 lines client getting out of memory error.
    How would i do that.
    please help

    I cannot report success with 10g streams, better maintenance and more useful views to track streams (static and dynamic), but still fails (like in 9i) when I have job running 12 hours, with thousands inserts/deletes/updates.
    On source site I don't know how big should streams_pool_size parameter be, probably 5 GB, which we don't have, process constantly getting killed with:
    ORA-23603: STREAMS enqueue aborted due to low SGA
    On target side, messages are not applied, everything goes to "spillover' and STREAMS tablespace is growing and growing and growing (due to table where messages are queued).
    SO, STREAMS ARE NOT GOOD FOR HUGE BATCH JOBS WHERE WE WANT ALMOST REAL TIME REPLICATION TO TARGET SIDE

  • What is difference between Documanage and Documaker?

    Guys..
    We are new to ECM, one of our customer is using both Documaker(Distributed) and Documanage for their vendor document management. So just I would like to know what would be the reason to use both? Instead can they use only documaker?
    Thanks in advance.
    Edited by: Ram on Nov 4, 2011 1:37 AM

    There is a huge level of difference - Documaker generates documents and print files based on a rules engine and document templates. Documanage does not generate any sort of documents - it is a document repository. Documaker incorporates a rudimentary transaction archive facility but it does not archive print streams or PDF documents, or anything else for that matter. This is where Documanage is quite usable.
    You would probably do well to investigate some of the documentation as your question is really too broad to answer with any appreciable level of detail.
    Documanage: http://download.oracle.com/docs/cd/E14904_01/E14904-01_index.html
    Documaker: http://download.oracle.com/docs/cd/E17552_01/e17552_01_index.html
    Edited by: Andy Little on Nov 4, 2011 11:09 AM

  • Upgrading to Acrobat X Web service calls slower...

    Hey,
    we made a plug-in button using javascript that takes the current document and sends it to a server using a webservice, the document is divided in chunks and sent to the server in size of 10 mg per chunk.
    this plug-in was working great, until the customer demanded that we migrate to acrobat x.
    we ran the same code and hit the wall to something similiar to this problem:
    http://forums.adobe.com/thread/756218?decorator=print&displayFullThrea d=true
    see, we figured out that the time it takes to communicate with the web service became slower depending on the size of the parameter sent to this service.
    when sending a chunk of 10 mega using 9 it took almost 15 sec.
    when sending a chunk of 80 kbyte using x it took almost 15 min.
    a sample code is shown below:
        var stream = Collab.documentToStream(document);
        var service = Net.SOAP.connect(url);
        var bound = 10485760;
        var documentSize = document.filesize;
        var thermo = app.thermometer;
        thermo.duration = Math.round(documentSize / bound);
        thermo.text = "Sending document to server";
        var counter = 0;
        thermo.begin();
        try {
            var stringReaded;
            var fileName = '';
            var parameter = {
                soapType: "xsd:string"
            do {
                thermo.value = counter;
                stringReaded = stream.read(bound);
                    parameter.jsonPdf = stringReaded;
                    fileName = service.SavePdf(parameter);
                counter++;
            while (stringReaded.length == bound * 2);
        catch (e) {
            app.alert(e);
        thermo.end();
    Update:
    Just un-installed x and downgraded to 9 with typical installation
    works like a sharm...
    still its needed to be deployed in 10 or x, any help is much appreciated

    What happens when you deactivate the Thermometer code?
    I believe to remember having the IMHO weird effect in Acrobat 9 that under some circumstances the Thermometer was speeding things up. This "bug" may have been "fixed" in 10.
    HTH.
    Max Wyss.

  • IOS 8 Photostream and Pages

    Ok, ever since upgrading to iOS 8 I've noticed some issues with how Pages and Photostream works with mine and my wife's iPhone. We both have iPhone 5s w/ iOS 8 and now the pictures she takes on her phone do not automatically download into my Photostream. When we had iOS 7 it worked. Same thing with Pages. We use Pages and now on her phone it is showing no documents but there are documents on my phone, they aren't syncing like they used to.
    I have it set up where I have an Apple ID on my phone and she has her Apple ID on her phone. In iOS 7 it was set up the same way, but I set up my Apple ID as a sub account so our calendars, notes, photos and Pages would sync. Now with iOS 8 I can add my account to her phone but it won't let me turn on Pages or Photostream and says only the main iCloud account can access those and those are all under my iCloud account she no longer can access Pages or our photos we take don't show up on each others Photostreams.
    So does anyone know how to get that back? I've turned on Family Sharing but it doesn't seem to work with Pages or Photostream. This was such a good feature and now I'm ****** they took it away with iOS 8. I know I can turn on a sharing album, but when it worked in Photostream I wouldn't have to add the pictures, they just showed up. I can't stand it when Apple takes features away and touts this new and great software and they cripple.
    Thank you
    Jeremy

    I suspect that something in your setups has changed, not so much iOS.  My wife and I each have separate iCloud accounts, but I set mine up as a secondary iCloud account on her iPhone and iPad so that we can share notes.  This worked just fine in iOS 7 and continues to work fine in iOS 8.  However, with this arrangement there never was the ability for her to see my Photo Stream or iCloud documents -- a secondary iCloud account never had the ability to access Photo Stream nor documents saved in iCloud, I'm quite certain of it.
    Instead, to do what you want to do, you need to set your iCloud account up on both iPhones as the primary iCloud account.  On her iPhone only, turn off the Contacts, Mail, etc. that she does not want to use from your iCloud account.  Then, on her iPhone add her iCloud account as a secondary account and she can use that for her Contacts, Mail, etc.  Be sure to change her iMessage and FaceTime settings such that you're not getting each other's communications -- do that by unselecting your iCloud email address on her iPhone as a point of contact, and add her own email (optional, but necessary if she has an iPad or Mac and wants to utilize iOS features like SMS relay).
    This will achieve what you want, and may have been how you had it set up in iOS 7, since there is no way it could have worked the way you described.

  • Video playback in on SonyEricsson phone

    Hi,
    I want to add video playback to my application. To get familar with the J2ME player, I tried the MMADemos in the WTK 2.2. They work on my S700i, but I can`t play videos! I've tried MPEG1, MPEG4 and 3GPP files, but I always get the following error message: 'Cannot create a Player for: at O' (then it's cut off). Audio files and Camera Video Capture work fine though.
    I hope someone can help me..
    Philipp

    Look for the "Video Streaming and Playback" document on the SE developer site for video compatibility information.

  • Server has not enough memory for operation (Some .rpt files not removing from Temp folder )

    We have web application developed in ASP.NET 4.0 ftramework and published on IIS. And we are using 13_0_8 version of CR.
    I am creating report files and exporting these as pdf. And I am disposing streams and report documents at the end. Initially, there wasn't any problem and temporary files which are created by CrystalReport were deleting all. But, now requests to the web application increeased to about 50.000 in a day and now some .rpt files are staying in Temp folder and I can't delete them. After recycling application pool all files are removed by IIS. Then, after 1 or 2 hours new .rpt files are creating in Temp folder. And after somewhile, application throws Server has not enough memory for operation. And, IMHO the reason is temp files. Here is the code I am using to export report as pdf.
    Questions:
    1. Is the reason of this exception is temp files in Temp folder?
    2. What is wrong in that code?
    ReportDocument report = DownloadPDF.GetReport(id);
       MemoryStream stream = (MemoryStream)report.ExportToStream(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat);
       Response.ContentType = "application/pdf";
       Response.AddHeader("content-disposition", "attachment; filename=" + id+ ".pdf");
      report.Close();
      report.Dispose();
       try
       Response.BinaryWrite(stream.ToArray());
       Response.End();
       catch (Exception)
       finally
      stream.Flush();
      stream.Close();
      stream.Dispose();
    Here is the StackTrace

    Hi Farhad
    At 50,000 requests, you are more than likely running into the CR engine limit. E.g.; you're pushing way too hard... The following will be good reads for you:
    Crystal Reports 2008 Component Engine Scalability | SCN
    (The above doc does apply to current versions of CR - e.g.; no changes.)
    Crystal Reports Maximum Report Processing Jobs ... | SCN
    Scaling Crystal Reports for Visual Studio .NET
    Choosing the Right Business Objects SDK for Your Needs
    Choose the Right SDK for the Right Task
    How Can I Optimize Scalability?
    All of the above apply to your version of CR and thus the next question will be; how to proceed:
    1) Bigger, faster servers will not hurt.
    2) Web farms.
    How Do I Use Crystal Reports in a Web Farm or Web Garden?
    3) Crystal Reports Application Server, or perhaps even SAP BusinessObjects BI Platform 4.1
    Crystal Enterprise Report Application Server - Overview
    - Ludek
    Senior Support Engineer AGS Product Support, Global Support Center Canada
    Follow us on Twitter

  • Blurry Images in Screen Saver - My Pictures

    Some of my pictures are not displaying "crisply" when the my pictures screen saver is running. I would say that 60/70 % display properly.
    I justed open a picture in iPhoto that was displaying inproperly and it opens fine. It was interesting though, when the photo initially displayed it displayed blurry but quickly changed to very crisp. The screen saver is displaying the photos like when a photo is initially opened in detail mode. Make sense?
    What could be the problem?

    Winston Winston, I figured it out!  I am so excited!
    Thanks for all your help!
    First I reset my photo stream.
    I realized after going to my photo stream there were actually no pictures in it.  I thought I had it all set up right but what I actually had was a file called photo stream in my documents I "sort of attached" that file to the actual photo stream, which at times showed photo's in the photo stream.
    When I realized there was really no photos in the actual photo stream, through iCloud, I went to iCloud.com and looked up how to add photos to photo stream manually from my PC.
    I am in the process of adding all my photo at the moment and I am so excited each time a new photo appears on my TV through Apple TV.
    Thanks for your patience
    DJ

Maybe you are looking for

  • Tax Condition in MM

    Hi Experts, Requirement....... CST u2013 Non Deductible Tax to be calculated  on Basic and Freight cost. All Tax being calculated using Tax Code VT. In MM Pricing Schema The  Condition Type FRA1 is maintained with sub-total u20184u2019, so  that FRA1

  • Missing selection screen for Bex Application iView

    Hi, I have configured a Bex Application iView, for which I am able to see the selection screen in preview but when I attach this to workset and try to open it in portal, the report is displayed directly with out selection screen. Here are the steps I

  • J1IIN Enhancement

    hi, I'm working with J1IIN, Create excise invoice for factor sale. My requirement is once i create the billing document number and posting date related information are storing under the table VBRK when i press save. But my requirement is These relate

  • Storage location for 331 movement

    Dear All. Is it possible to assign storage location for sample usage movement in UD inspection lot stock tab. our requiremnt is through lot post material by 331 movement to Scrap storage location. Regards. dev123

  • Missing details in hardware inventory

    Hi, Hardware inventory details about Logical and Physical disks are not available for any of my managed workstations. ZLM7.2 HP3 server and agents. Is anyone experiencing the same problem? Thanks, Ovidiu