OutOfMemoryError When Sending Large Image

Hi All,
We are developing a midlet that is esentially a photo blogging app. We are using an HTTP POST to send the image to the web server. The code is working properly as we are able to send images up to about 80KB.
However, when sending images larger than ~80KB, the midlet gets an OutOfMemoryError.
The image is being sent in chunked data packets, so shouldn't this mean we could send any size file since it would just keep sending more data chunks until it has reached the end of the file?...
Has anyone else out there encountered this or perhaps know of a work around?
Any help would be greatly appreciated.
Thanks!
Jim

We are currently loading the entire image into memory at the moment which is
probably causing the OutOfMemory exceptions. Would you know how native
phone applications send images through HTTP which are many times the
size of available memory?
The only way I could think of is to somehow connect the input stream
which gets the image from the phone's memory and the output stream
which writes out the HTTP data. By doing this no new byte array will get
declared (explicitly anyway) to temporarily hold the entire image in the phone's
memory. I'm wondering could I accomplish something like that by somehow
collapsing these two chunks of code into one that declares no arrays to hold
the entire image in memory?
Here's our current code for reference:
Getting the image from the phone
theFile is a FileConnection object which references the image file we want
                    InputStream fileInputStream = theFile.openInputStream();
                    fileContent = new byte[(int)filesize];
                    fileInputStream.read(fileContent);
                    fileInputStream.close();Writing image to HTTP output stream
data is a byte[] array holding the entire image in memory
httpOut is a DataOutputStream
SuperViewerMidlet.httpOut.write(data);

Similar Messages

  • Not able to see the output in sost when sending the image in email body

    I am sending the image in email body and when m trying to see the output in SOST then it showing a page 'you are not connected to the internet'
    I am able to see the output when m saving local objects but when m saving it in some package its showing me this page
    Kindly help it
    Regards
    Pratham Kapoor

    Hello Prakash,
    Thanks for the reply
    I am able to see the mail in SOST but when I click on the Display Document to see the content of the mail then I am getting this error of 'you are not connected to the internet'
    My Program is to put the logo in my email body
    I am sending you the attached image

  • OutOfMemoryError when retrieving large resultset

    In my application I have one type of object (Call it O for now) that has
    a lot of data in the database (+50000 rows). Now I need to create an
    object of class T that has a m-n binding to 40000 instances of O. In the
    database this is mapped to a link table between the table for O and T.
    Now I get an OutOfMemoryError when I perform the following code to add
    one T to the aforementioned O:
    PersistenceManager pm = VRFUtils.getPM(getServlet());
    T t = new T();
    //Fill arbitrary fields
    t.setToelichting(mtForm.getToelichting());
    //Add T to a set of O's
    Set os = new HashSet();
    Query q = pm.newQuery(O.class,"aangemaakt==parmaanmaak");
    q.declareParameters("java.util.Date parmaanmaak");
    os.addAll(q.execute(field));
    t.setOs(os);
    //Make T persistent
    pm.currentTransaction().begin();
    pm.makePersistent(toelichting);
    pm.currentTransaction().commit();
    pm.close();
    After debugging I've found that the OutOfMemoryError occurs even when I
    don't make anything persistent, but simply run the query that retrieves
    40000 records and do a c.size() on the result.
    I'm running Kodo against MySQL using Optimistic transactions.
    What I must appreciate, is that the OutOfMemoryError does not upset the
    rest of the Kodo system.
    Please advise,
    Martin van Dijken
    PS: The c.size() issue I've been able to resolve using KodoQuery's
    setResult("count(this)"), but I can't think of anything like that, that
    would apply to this situation.

    As you may know, Kodo has several settings that allow you to use large
    result sets without running out of memory (assuming your driver supports
    advanced features):
    http://www.solarmetric.com/Software/Documentation/latest/docs/ref_guide_dbsetup_lrs.html
    Kodo also allows you to apply these settings to persistent fields, so
    that the entire collection or map field does not reside in memory:
    http://www.solarmetric.com/Software/Documentation/latest/docs/ref_guide_pc_scos.html#ref_guide_pc_scos_proxy_lrs
    Unfortunately, you are trying to create a relation containing more
    objects than your system can handle, apparently, and when creating a
    relation you pretty much have to load all the related objects into
    memory at once right now.
    In the next beta release of 3.1, there is a solution to this problem.
    Our next release no longer holds hard references to objects that have
    been flushed. So by using the proper large result set settings as noted
    above, and by making your relation a large result set relation also as
    noted above, and by adding only a few hundred objects at a time from the
    query result to the relation and then manually flushing, you should be
    able to perform a transaction in which all the queried objects are
    transferred from the query result to the large result set relation
    without exhausting memory.

  • Photoshop CS5 crashing my Mac when resizing large images

    I don't have much to explain this further but Photoshop CS5 is crashing my Mac when I resize large images.  Small images are fine but large 300dpi images crashes it without warning.  Don't know what to do.  The only other similar thing is After Effects CS5 is crashing my Mac when I trim a clip.  It completely turns off my Mac when I trim a clip. 
    I have 8gigs of Ram and am running 27" iMac Core i5
    Any help would be much appreciated!
    Thanks,
    Hal

    Hi Wendy
    Thank you for your insights. We are having the same problems here.
    It's been a headache as we bought two 27" iMacs in March 2011; and we've had even BOTH iMacs exchanged.
    After exchanging, same thing happened. We then got all 16GB of RAM on each iMac replaced.
    But we noticed that the auto-shutdown problem happens with files on 300dpi. We are contemplating on changing them to 299dpi though haha!
    Unfortunately, here in Singapore, we don't have a physical Apple store. We only have Premium Resellers.
    And the other unfortunate thing is, when RAMs are upgraded these Premium Resellers sell 3rd party RAMs.
    I supposed we'll have to deal with this for now until we have enough funds to replace ALL 32 RAMs to original Apple RAMs (which will cost abt another USD1600!!) ..
    Hope this forum helps others as much as it finally helped me understand the issue we're having.

  • Bug when exporting large images

    I found this bug in Flash 8, so I just downloaded CS5.5 trial and I see the same problem.
    When I increase the image export resolution to get a larger image, at one point the lower section of the image became white (the image has the appropriate size but the content is not rendered in the lower section). As bigger is the image, larger is the white fraction. The amount of useful pixels always stay around 10 or 13 megapixels. Here some examples:
    Original image was 3375x6710 pixels in the left one and 2625x5219 en the right one. Any idea to solve this?? Can anyone reproduce this problem?

    That article is regarding the size of the bitmaps you can put INSIDE the project, and the issue I'm experiencing is regarding the size of the output when you use the "Export image" function.
    Actually I got the same problem even if I delete all bitmaps from the stage and try to export only the vector features (lines, text, etc...).
    I can't see clearly how the limit explained in that article could be related to a limit of exported images.
    As example, the following image shows the same issue, but this time of a project with only vector data, no bitmaps at all, you can see how the rendering is truncated.

  • Labview crashes when creating large image files

    I have a problem with Labview 6.0.2( I've tested evaluation version 7.0 too).
    I'm constructing a very large image, for example: 4500x4500 pixels. Labview crashes when converting the pixture to a pixmap. The image is fully constructed on my screen (in a picture control), but when converting it to a pixmap (for saving the image in a known format (bmp, jpg, tiff)), Labview crashes.
    I did some testing and when the number of pixels exceeded the limit of 2^24(16777216), the file 'image.cpp' crashes on line 1570. The vi to convert it to a pixmap is: P'icture to pixmap.vi'
    Does someone know a workaround for this problem? Or is there a fix for it?
    Thank you!

    I've tested the 6i version of my VI in Labview 7.0 evalutation version. It raised an error but not the same error:
    d:\lvworm\src\lvsource\compatexport.cpp(37) : DAbort: Called a routine not in the compatibility LVRT table
    $Id: //labview/branches/Wormhole/dev/lvsource/compatexport.cpp#11 $
    0x004BD4CB - LabVIEW_Eval + 0
    0x0EB710D9 - lvs248 + 0
    0x094C87A0 - + 0
    So i replaced the picture VI's with the 7.0 evalutation version VI's, and it worked. It is now possible for me to construct very large image files!
    I see no attached VI to test. But i guess it is also solved in Labview 7.0
    I used this file to convert the picture to image data:
    C:\Program Files\National Instruments\LabVIEW 7.0 Evaluation\vi.lib
    \picture\pictutil.llb\Picture to Pixmap.vi
    And this file to convert image data to bmp:
    C:\Program Files\National Instruments\LabVIEW 7.0 Evaluation\vi.lib\picture\bmp.llb\Write BMP File.vi
    I guess i have to write a workaround for this problem:
    divide the picture in blocks of 4096 x 4096 and then merge the image data arrays of the bloks together.

  • I can't send large images any longer, what gives?

    I recently upgraded to OSX 10.5.2. I can't say that's when this problem started though I suspect it. I can still send images and select one of three sizes however, all are very small for some reason, full size is about 160kb.

    As described above and on the other threads you've made multiple posts on:
    Uploaded with plasq's Skitch!
    Can you explain if this does not work for you?
    Regards
    TD
    Message was edited by: Terence Devlin

  • IOS packager throws java.lang.OutOfMemoryError when packaging large projects

    Crosspost from stackoverflow, I figured this forum might have some insights too!
    I've been porting a Flex 4 codebase to iOS using the adobe packager, but have run into a snag when trying to package our whole codebase. The packager runs for a while and then throws an OutOfMemoryError - even if I increase the java heap size to 4GB.
    No single piece of code seems to be causing the problem, as it compiles successfully if I cut out large chunks of code, and I can change which chunks I'm omitting. It might be related to the size of the code itself.
    I've logged a very detailed bug report with adobe here: http://bugs.adobe.com/jira/browse/FB-32192 . It includes an AIRI file that you can package to reproduce the issue, a ruby script that generates actionscript code to generate that AIRI file, and a summary of all of the things I tried before logging the bug.
    Has anyone else tried compiling large projects with the iOS packager? Are there any known workarounds?

    Thanks for reporting the issue, we are working on it, hopefully it will be available in next major version of AIR.
    To know more about it, you might want nominate yourself for our prerelease program at this link.
    http://labs.adobe.com/technologies/flashplatformruntimes/air3/
    Thanks,
    Amish.

  • When sending large messages through iMail, they disappear from the Sent fol

    This is a peculiar problem that we only see with our (only) Mac/iMail user. The client is iMail that uses IMAP/SMTP to comm with our Exchange server. The iMail user is able to send and receive email just fine. However, we just noticed that whenever he sends messages with large attachments (at least a couple of MB), the messages appear briefly in his Sent folder but then immediately disappear. We do know that the recipients receive the message. We did not find any rules in iMail that would cause that to happen, and the Exchanger server is not setup to do anything with messages based on size. We can send a message with the same attachments (and resulting size) from Outlook and Thunderbird clients, and the message stays in the Sent folders in those.
    Thanks for any advice
    MJ

    I'm not sure if this is the same problem, but I'd also welcome advice: I'm trying to send an email via Mail, with quite a large attachment. I've made a .zip file of it to try to save space; however, when I click on 'Send', it appears in my Outbox - but never makes it into the Send box.
    I can't fathom why this would be - if anyone has any suggestions - especially for how to send this thing! it's quite urgent! - I'd be really grateful.

  • OutOfMemoryError when sending JMSMessage

    Hi, everyone.
    My application is a JMS client which runs on oc4j 9.0.0.4 and connects JMS listener to another server (Weblogic8.1). It receives a JMS message in every 2 seconds. Each time onMessage is called, the message is published to the JMS Topic on the local server.
    The problem is it keeps running fine for a few days, but after that starts "getting JMSException : storeMessage" as below when publishing received message to the local JMS topic. The JMS listener keeps working for another 30 seconds with this error and sometimes without any trouble. Then the listener suddenly stops and it never receives message any more. Almost the same moment, there is this message in the jms.log.
    05/09/14 17:06:32 computeSize
    java.lang.OutOfMemoryError
    Other than JMS listener, the oc4j seems to be working fine. I can get successful responce from the servlets and jsps.
    Does anybody have any clue why this happens? Or is there any workaround as to allocate the bigger heap on JMS topic?
    I appreciate your HELP!!!
    -------Here is the stacktrace --------------
    05/09/14 17:06:31 javax.jms.JMSException: storeMessage(ID:Oc4jJMS.Message.SYS037203.88e2dd:1064d0336d0:-8000.40727,null)
    05/09/14 17:06:31      at com.evermind.server.jms.JMSUtils.makeJMSException(JMSUtils.java:1843)
    05/09/14 17:06:31      at com.evermind.server.jms.JMSUtils.toJMSException(JMSUtils.java:1859)
    05/09/14 17:06:31      at com.evermind.server.jms.ServerStore.storeMessage(ServerStore.java:757)
    05/09/14 17:06:31      at com.evermind.server.jms.ServerStore.enq(ServerStore.java:157)
    05/09/14 17:06:31      at com.evermind.server.jms.ServerTopic.enq(ServerTopic.java:464)
    05/09/14 17:06:31      at com.evermind.server.jms.ServerTopic.enq(ServerTopic.java:97)
    05/09/14 17:06:31      at com.evermind.server.jms.JMSProvider.enqMessage(JMSProvider.java:574)
    05/09/14 17:06:31      at com.evermind.server.jms.EvermindSession.send(EvermindSession.java:1098)
    05/09/14 17:06:31      at com.evermind.server.jms.EvermindMessageProducer.send(EvermindMessageProducer.java:409)
    05/09/14 17:06:31      at com.evermind.server.jms.EvermindMessageProducer.send(EvermindMessageProducer.java:201)
    05/09/14 17:06:31      at com.evermind.server.jms.EvermindTopicPublisher.publish(EvermindTopicPublisher.java:77)
    05/09/14 17:06:31      at com.mypackage.sender.JmsObjectSender.send(JmsObjectSender.java:145)
    05/09/14 17:06:31      at com.mypackage.sender.JmsObjectSender.run(JmsObjectSender.java:108)

    How big are the messages?
    The OutOfMemoryError means that there was inadequate memory to make a temporary copy (or two) of the message for book-keeping purposes. So either you are way low on memory or you have some really big message.
    Are you using a persistent topic? (I.e., did you set a persistence file for it in jms.xml)? If not, do so. And turn on paging of message bodies. Are you reading all of the messages out of the topic (for all subscribers)? If not they will accumulate until you're out of memory.

  • OutOfMemoryError when storing many image information

    I have to store about 400 images(640*480) information into an array. I use a loop to grab the pixel from pictures one by one but when program goes to 14th pictures, OutOfMemoryError exception comes out.
    Here is part of my program.
    for(int i=0;i<totalFile;i++){
    pixels_crop1=grabPixel(im,0,0,width,height);
    //sign the value of pixels_crop1 to another object
    How can I resolve this problem?
    thx

    By increasing the heap space using the command line option that exists for that purpose...
    http://java.sun.com/j2se/1.4.2/docs/tooldocs/windows/java.html

  • Exchange stops receiving SMTP emails when sending large amount of invoices.

    We have an exchange server and a computer with an invoicing program loaded on it. At various times of the month, the invoicing program will go through our database and generate email invoices. The problem comes when we try to send them all at once. (Roughly
    800 invoices) Each email is slightly different and each email only has one destination, but if we try to send more than about 50 at a time the exchange server will receive the first roughly 100 (amount varies) and then not receive the rest though the sending
    app says all messages were sent. I'm sure the issue lays with exchange because we used a simple free smtp mail server program for testing and it received them all without issue.  Is there a place where you set how many SMTP messages the server will
    accept in a single session/connection?  Looking at the queue I can also see that the messages arrive one after another at roughly 2-3 second intervals.  Any help would be greatly appreciated.

    I would check Message Throttling on the Exchange server.  Specifically the Set-ReceiveConnector settings for MaxInboundConnectionPercentagePerSource
    and MaxInboundConnectionPerSource.
    http://technet.microsoft.com/en-us/library/bb232205(v=exchg.150).aspx

  • Error "java.lang.OutOfMemoryError" When Returning Large Number of Docs

    In our SES implementation, we have a custom search interface that allows users to search for documents and then add them to a "shopping cart". Users add then to their shopping cart from search results, by adding docs one-by-one or an Add All option. Once they are done "shopping" they create a report.
    Here is the scenario...
    Users are saerching for documents and seeing that on page 1, there is 1 - 10 of about 300 results. They clicked Add All and want all 300 docs added to their cart.
    What we do under the covers is we execute another search and set the docs requested to 200. We get the array of docs, iterate over them and add the keys to a list. We found 200 docs at a time to be a safe number. However, there are still 100 docs that were not added to their cart and users want all 300 added. In other words, when they click Add All, they want to add all docs, 300, 500, 5000, etc.
    I set the "Maximum Number of Results" to 500 and found that I can safely add up to ~ 350 docs at one time. However, going past this point throws the following error:
    [SOAPException: faultCode=SOAP-ENV:Server; msg= [java.lang.OutOfMemoryError]]
         at oracle.search.query.webservice.client.OracleSearchService.makeSOAPCallRPC(OracleSearchService.java:941)
         at oracle.search.query.webservice.client.OracleSearchService.doOracleSearch(OracleSearchService.java:469)
    After this error is thrown, SES was unable to recover and searching would not work anymore, even return 10 docs at a time. We had to restart SES to resolve the issue.
    1. What is throwing this error? Is it the amount of XML being returned?
    2. What is the maximum number of results we can get back at any one time? Is it based on the amount of data being returned or the number of attributes?
    We are running 10.1.8 with plans to upgrade soon.
    Thanks in advance.

    I know it may be hard to throw away all this code, but consider using the jakarta fileupload component.
    I think it would simplify your code down to
    // Create a factory for disk-based file items
    FileItemFactory factory = new DiskFileItemFactory();
    // Create a new file upload handler
    ServletFileUpload upload = new ServletFileUpload(factory);
    // Parse the request
    List /* FileItem */ items = upload.parseRequest(request);
    // Process the uploaded items
    Iterator iter = items.iterator();
    while (iter.hasNext()) {
        FileItem item = (FileItem) iter.next();
        if (item.isFormField()) {
            processFormField(item);
        } else {
            // item is a file.  write it
            File saveFolder = application.getRealPath("/file");          
            File uploadedFile = new File(saveFolder, item.getName());
            item.write(uploadedFile);
    }Most of this code was hijacked from http://jakarta.apache.org/commons/fileupload/using.html
    Check it out. It will solve your memory problem by writing the file to disk temporarily if necessary.
    Cheers,
    evnafets

  • Not receiving email when sending large number of records using a FM?

    Hi..
    I am using the function module " SO_DOCUMENT_SEND_API1 " to send email....
    When a single record is there.. or around 5-6 records are there... email is coming successfully...
    But when there are more records..say around 100, the email is not coming... I checked SOST transaction and the status there is in red..and the error message is " Internal error: SO_OBJECT_MIME_GET Exception: 2 ".........
    What could be the reason behind this problem....... ??
    I have another problem... my output has over 60 fields, but in the email which i am receiving has only around 10 fields... how to solve this problem...??
    Plz help...

    Well... right now i am tryin to get only the first 2 fields.. but even in this case... i am not getting the email if around 15 records are there......
    I am using the code which is given below which i found in SDN only......In this code.. data is getting selected from EKPO... i tried changing the number of rows getting selected.. and in this case, the attachement is coming as desired... but when i use the same code for my prog.. i am not getting the mail.. even if there are only 10 records or so...
    *& Report  ZT062108   ALV Header                                    *
    REPORT  zt062108.
    TABLES: ekko.
    PARAMETERS: p_email   TYPE somlreci1-receiver
                                      DEFAULT '<give email here>'.
    TYPES: BEGIN OF t_ekpo,
      ebeln TYPE ekpo-ebeln,
      ebelp TYPE ekpo-ebelp,
      aedat TYPE ekpo-aedat,
      matnr TYPE ekpo-matnr,
    END OF t_ekpo.
    DATA: it_ekpo TYPE STANDARD TABLE OF t_ekpo INITIAL SIZE 0,
          wa_ekpo TYPE t_ekpo.
    TYPES: BEGIN OF t_charekpo,
      ebeln(10) TYPE c,
      ebelp(5)  TYPE c,
      aedat(8)  TYPE c,
      matnr(18) TYPE c,
    END OF t_charekpo.
    DATA: wa_charekpo TYPE t_charekpo.
    DATA:   it_message TYPE STANDARD TABLE OF solisti1 INITIAL SIZE 0
                    WITH HEADER LINE.
    DATA:   it_attach TYPE STANDARD TABLE OF solisti1 INITIAL SIZE 0
                    WITH HEADER LINE.
    DATA:   t_packing_list LIKE sopcklsti1 OCCURS 0 WITH HEADER LINE,
            t_contents LIKE solisti1 OCCURS 0 WITH HEADER LINE,
            t_receivers LIKE somlreci1 OCCURS 0 WITH HEADER LINE,
            t_attachment LIKE solisti1 OCCURS 0 WITH HEADER LINE,
            t_object_header LIKE solisti1 OCCURS 0 WITH HEADER LINE,
            w_cnt TYPE i,
            w_sent_all(1) TYPE c,
            w_doc_data LIKE sodocchgi1,
            gd_error    TYPE sy-subrc,
            gd_reciever TYPE sy-subrc.
    *START_OF_SELECTION
    START-OF-SELECTION.
    *   Retrieve sample data from table ekpo
      PERFORM data_retrieval.
    *   Populate table with detaisl to be entered into .xls file
      PERFORM build_xls_data_table.
    *END-OF-SELECTION
    END-OF-SELECTION.
    * Populate message body text
      perform populate_email_message_body.
    * Send file by email as .xls speadsheet
      PERFORM send_file_as_email_attachment
                                   tables it_message
                                          it_attach
                                    using p_email
                                          'Example .xls documnet attachment'
                                          'TXT'
                                          'filename'
                                 changing gd_error
                                          gd_reciever.
    *   Instructs mail send program for SAPCONNECT to send email(rsconn01)
      PERFORM initiate_mail_execute_program.
    *&      Form  DATA_RETRIEVAL
    *       Retrieve data form EKPO table and populate itab it_ekko
    FORM data_retrieval.
      SELECT ebeln ebelp aedat matnr
       UP TO 1000 ROWS
        FROM ekpo
        INTO TABLE it_ekpo.
    ENDFORM.                    " DATA_RETRIEVAL
    *&      Form  BUILD_XLS_DATA_TABLE
    *       Build data table for .xls document
    FORM build_xls_data_table.
    *  CONSTANTS: con_cret TYPE x VALUE '0D'.  "OK for non Unicode
    *             con_tab TYPE x VALUE '09'.   "OK for non Unicode
    *If you have Unicode check active in program attributes thnen you will
    *need to declare constants as follows
    *class cl_abap_char_utilities definition load.
    constants:
        con_tab  type c value cl_abap_char_utilities=>HORIZONTAL_TAB,
        con_cret type c value cl_abap_char_utilities=>CR_LF.
      CONCATENATE 'EBELN' 'EBELP' 'AEDAT' 'MATNR'
             INTO it_attach SEPARATED BY con_tab.
      CONCATENATE con_cret it_attach  INTO it_attach.
      APPEND  it_attach.
      LOOP AT it_ekpo INTO wa_charekpo.
        CONCATENATE wa_charekpo-ebeln wa_charekpo-ebelp
                    wa_charekpo-aedat wa_charekpo-matnr
               INTO it_attach SEPARATED BY con_tab.
        CONCATENATE con_cret it_attach  INTO it_attach.
        APPEND  it_attach.
      ENDLOOP.
    ENDFORM.                    " BUILD_XLS_DATA_TABLE
    *&      Form  SEND_FILE_AS_EMAIL_ATTACHMENT
    *       Send email
    FORM send_file_as_email_attachment tables pit_message
                                              pit_attach
                                        using p_email
                                              p_mtitle
                                              p_format
                                              p_filename
                                              p_attdescription
                                              p_sender_address
                                              p_sender_addres_type
                                     changing p_error
                                              p_reciever.
      DATA: ld_error    TYPE sy-subrc,
            ld_reciever TYPE sy-subrc,
            ld_mtitle LIKE sodocchgi1-obj_descr,
            ld_email LIKE  somlreci1-receiver,
            ld_format TYPE  so_obj_tp ,
            ld_attdescription TYPE  so_obj_nam ,
            ld_attfilename TYPE  so_obj_des ,
            ld_sender_address LIKE  soextreci1-receiver,
            ld_sender_address_type LIKE  soextreci1-adr_typ,
            ld_receiver LIKE  sy-subrc.
      ld_email   = p_email.
      ld_mtitle = p_mtitle.
      ld_format              = p_format.
      ld_attdescription      = p_attdescription.
      ld_attfilename         = p_filename.
      ld_sender_address      = p_sender_address.
      ld_sender_address_type = p_sender_addres_type.
    * Fill the document data.
      w_doc_data-doc_size = 1.
    * Populate the subject/generic message attributes
      w_doc_data-obj_langu = sy-langu.
      w_doc_data-obj_name  = 'SAPRPT'.
      w_doc_data-obj_descr = ld_mtitle .
      w_doc_data-sensitivty = 'F'.
    * Fill the document data and get size of attachment
      CLEAR w_doc_data.
      READ TABLE it_attach INDEX w_cnt.
      w_doc_data-doc_size =
         ( w_cnt - 1 ) * 255 + STRLEN( it_attach ).
      w_doc_data-obj_langu  = sy-langu.
      w_doc_data-obj_name   = 'SAPRPT'.
      w_doc_data-obj_descr  = ld_mtitle.
      w_doc_data-sensitivty = 'F'.
      CLEAR t_attachment.
      REFRESH t_attachment.
      t_attachment[] = pit_attach[].
    * Describe the body of the message
      CLEAR t_packing_list.
      REFRESH t_packing_list.
      t_packing_list-transf_bin = space.
      t_packing_list-head_start = 1.
      t_packing_list-head_num = 0.
      t_packing_list-body_start = 1.
      DESCRIBE TABLE it_message LINES t_packing_list-body_num.
      t_packing_list-doc_type = 'RAW'.
      APPEND t_packing_list.
    * Create attachment notification
      t_packing_list-transf_bin = 'X'.
      t_packing_list-head_start = 1.
      t_packing_list-head_num   = 1.
      t_packing_list-body_start = 1.
      DESCRIBE TABLE t_attachment LINES t_packing_list-body_num.
      t_packing_list-doc_type   =  ld_format.
      t_packing_list-obj_descr  =  ld_attdescription.
      t_packing_list-obj_name   =  ld_attfilename.
      t_packing_list-doc_size   =  t_packing_list-body_num * 255.
      APPEND t_packing_list.
    * Add the recipients email address
      CLEAR t_receivers.
      REFRESH t_receivers.
      t_receivers-receiver = ld_email.
      t_receivers-rec_type = 'U'.
      t_receivers-com_type = 'INT'.
      t_receivers-notif_del = 'X'.
      t_receivers-notif_ndel = 'X'.
      APPEND t_receivers.
      CALL FUNCTION 'SO_DOCUMENT_SEND_API1'
           EXPORTING
                document_data              = w_doc_data
                put_in_outbox              = 'X'
                sender_address             = ld_sender_address
                sender_address_type        = ld_sender_address_type
                commit_work                = 'X'
           IMPORTING
                sent_to_all                = w_sent_all
           TABLES
                packing_list               = t_packing_list
                contents_bin               = t_attachment
                contents_txt               = it_message
                receivers                  = t_receivers
           EXCEPTIONS
                too_many_receivers         = 1
                document_not_sent          = 2
                document_type_not_exist    = 3
                operation_no_authorization = 4
                parameter_error            = 5
                x_error                    = 6
                enqueue_error              = 7
                OTHERS                     = 8.
    * Populate zerror return code
      ld_error = sy-subrc.
    * Populate zreceiver return code
      LOOP AT t_receivers.
        ld_receiver = t_receivers-retrn_code.
      ENDLOOP.
    ENDFORM.
    *&      Form  INITIATE_MAIL_EXECUTE_PROGRAM
    *       Instructs mail send program for SAPCONNECT to send email.
    FORM initiate_mail_execute_program.
      WAIT UP TO 2 SECONDS.
      SUBMIT rsconn01 WITH mode = 'INT'
                    WITH output = 'X'
                    AND RETURN.
    ENDFORM.                    " INITIATE_MAIL_EXECUTE_PROGRAM
    *&      Form  POPULATE_EMAIL_MESSAGE_BODY
    *        Populate message body text
    form populate_email_message_body.
      REFRESH it_message.
      it_message = 'Please find attached a list test ekpo records'.
      APPEND it_message.
    endform.                    " POPULATE_EMAIL_MESSAGE_BODY

  • Timeouts when sending larger mp3 files

    Hi,
    I have dial-up and when trying to send 1MB mp3 files, I get a timeout error and it won't send. Is there a way to change the timeout setting to be longer? I couldn't find it in prefs and have done searches here and everywhere on the net but can't find an answer that makes any sense to me.
    Thank you very much for any help with this.

    enezinorm, Welcome to the discussion area!
    Are you attaching the .mp3 extension on the end of the file?

Maybe you are looking for