How can I send an image through a WebService

Hi,
I'm trying to send an image through a WebService to a mobile phone, but I can't get it working.
Anyone knows how I can send an image on the server side, and receive it on the client side?
Thanks for your help.

Hope this will help
String encodingStyleURI = org.apache.soap.Constants.NS_URI_SOAP_ENC;
SOAPMappingRegistry smr = new SOAPMappingRegistry();
BeanSerializer beanSer = new BeanSerializer();
try {
// Build the call.
Call call = new Call();
call.setSOAPMappingRegistry(smr);
call.setTargetObjectURI("urn:filereceiver");
call.setMethodName("loopFile");
call.setEncodingStyleURI(encodingStyleURI);
Vector params = new Vector();
DataSource ds = new ByteArrayDataSource(new File(fname),
                              null);
DataHandler dh = new DataHandler(ds);
params.addElement(new Parameter("addedfile",
                         javax.activation.DataHandler.class, dh, null));
params.addElement( new Parameter( "filename", String.class,fname, null ) );
call.setParams(params);
// Invoke the call.
Response resp;
try {
     System.out.println(url);
resp = call.invoke(url, "");
} catch (SOAPException e) {
          FLAG          ="NO";
          System.err.println("Caught SOAPException (" +
                    e.getFaultCode() + "): " +
                    e.getMessage());
          e.printStackTrace();
return FLAG;
// Check the response.
if (!resp.generatedFault()) {
Parameter ret = resp.getReturnValue();
if (ret == null){
System.out.println("No response.");
          FLAG="NO";
else {
          // System.out.println("Response: " + resp);
// printObject(ret.getValue());
} else {
Fault fault = resp.getFault();
          FLAG          ="NO";
System.err.println("Generated fault: ");
System.err.println(" Fault Code = " + fault.getFaultCode());
System.err.println(" Fault String = " + fault.getFaultString());

Similar Messages

  • How can I send purchase order through SAP mail ?

    How can I send purchase order through SAP mail ? Can any one explain whts the NACE settings?

    just  do it as  <b>Anji reddy</b> said to you   ...or else  ...  in the purchase  order trascation  ...print it  ... so that  it will generate the spool request  for that  purchase  order  ....
    so the   the belwo program is for sending <b>the Spool   Request  data   as  Email  to  any Email id  ...</b>
    The code below demonstrates how to retrieve a spool request and email it as a PDF document. Please note for the below program to process a spool request the program must be executed in background otherwise no spool request will be created. Once you have had a look at this there is an modified version of the program which works in both background and foreground. Also see transaction SCOT for SAPConnect administration.
    *& Report  ZSPOOLTOPDF                                                 *
    *& Converts spool request into PDF document and emails it to           *
    *& recipicant.                                                         *
    *& Execution                                                           *
    *& This program must be run as a background job in-order for the write *
    *& commands to create a Spool request rather than be displayed on      *
    *& screen                                                              *
    REPORT  zspooltopdf.
    PARAMETER: p_email1 LIKE somlreci1-receiver
                                        DEFAULT '[email protected]',
               p_sender LIKE somlreci1-receiver
                                        DEFAULT '[email protected]',
               p_delspl  AS CHECKBOX.
    *DATA DECLARATION
    DATA: gd_recsize TYPE i.
    * Spool IDs
    TYPES: BEGIN OF t_tbtcp.
            INCLUDE STRUCTURE tbtcp.
    TYPES: END OF t_tbtcp.
    DATA: it_tbtcp TYPE STANDARD TABLE OF t_tbtcp INITIAL SIZE 0,
          wa_tbtcp TYPE t_tbtcp.
    * Job Runtime Parameters
    DATA: gd_eventid LIKE tbtcm-eventid,
          gd_eventparm LIKE tbtcm-eventparm,
          gd_external_program_active LIKE tbtcm-xpgactive,
          gd_jobcount LIKE tbtcm-jobcount,
          gd_jobname LIKE tbtcm-jobname,
          gd_stepcount LIKE tbtcm-stepcount,
          gd_error    TYPE sy-subrc,
          gd_reciever TYPE sy-subrc.
    DATA:  w_recsize TYPE i.
    DATA: gd_subject   LIKE sodocchgi1-obj_descr,
          it_mess_bod LIKE solisti1 OCCURS 0 WITH HEADER LINE,
          it_mess_att LIKE solisti1 OCCURS 0 WITH HEADER LINE,
          gd_sender_type     LIKE soextreci1-adr_typ,
          gd_attachment_desc TYPE so_obj_nam,
          gd_attachment_name TYPE so_obj_des.
    * Spool to PDF conversions
    DATA: gd_spool_nr LIKE tsp01-rqident,
          gd_destination LIKE rlgrap-filename,
          gd_bytecount LIKE tst01-dsize,
          gd_buffer TYPE string.
    * Binary store for PDF
    DATA: BEGIN OF it_pdf_output OCCURS 0.
            INCLUDE STRUCTURE tline.
    DATA: END OF it_pdf_output.
    CONSTANTS: c_dev LIKE  sy-sysid VALUE 'DEV',
               c_no(1)     TYPE c   VALUE ' ',
               c_device(4) TYPE c   VALUE 'LOCL'.
    *START-OF-SELECTION.
    START-OF-SELECTION.
    * Write statement to represent report output. Spool request is created
    * if write statement is executed in background. This could also be an
    * ALV grid which would be converted to PDF without any extra effort
      WRITE 'Hello World'.
      new-page.
      commit work.
      new-page print off.
      IF sy-batch EQ 'X'.
        PERFORM get_job_details.
        PERFORM obtain_spool_id.
    *** Alternative way could be to submit another program and store spool
    *** id into memory, will be stored in sy-spono.
    *submit ZSPOOLTOPDF2
    *        to sap-spool
    *        spool parameters   %_print
    *        archive parameters %_print
    *        without spool dynpro
    *        and return.
    * Get spool id from program called above
    *  IMPORT w_spool_nr FROM MEMORY ID 'SPOOLTOPDF'.
        PERFORM convert_spool_to_pdf.
        PERFORM process_email.
        if p_delspl EQ 'X'.
          PERFORM delete_spool.
        endif.
        IF sy-sysid = c_dev.
          wait up to 5 seconds.
          SUBMIT rsconn01 WITH mode   = 'INT'
                          WITH output = 'X'
                          AND RETURN.
        ENDIF.
      ELSE.
        SKIP.
        WRITE:/ 'Program must be executed in background in-order for spool',
                'request to be created.'.
      ENDIF.
    *       FORM obtain_spool_id                                          *
    FORM obtain_spool_id.
      CHECK NOT ( gd_jobname IS INITIAL ).
      CHECK NOT ( gd_jobcount IS INITIAL ).
      SELECT * FROM  tbtcp
                     INTO TABLE it_tbtcp
                     WHERE      jobname     = gd_jobname
                     AND        jobcount    = gd_jobcount
                     AND        stepcount   = gd_stepcount
                     AND        listident   <> '0000000000'
                     ORDER BY   jobname
                                jobcount
                                stepcount.
      READ TABLE it_tbtcp INTO wa_tbtcp INDEX 1.
      IF sy-subrc = 0.
        message s004(zdd) with gd_spool_nr.
        gd_spool_nr = wa_tbtcp-listident.
        MESSAGE s004(zdd) WITH gd_spool_nr.
      ELSE.
        MESSAGE s005(zdd).
      ENDIF.
    ENDFORM.
    *       FORM get_job_details                                          *
    FORM get_job_details.
    * Get current job details
      CALL FUNCTION 'GET_JOB_RUNTIME_INFO'
           IMPORTING
                eventid                 = gd_eventid
                eventparm               = gd_eventparm
                external_program_active = gd_external_program_active
                jobcount                = gd_jobcount
                jobname                 = gd_jobname
                stepcount               = gd_stepcount
           EXCEPTIONS
                no_runtime_info         = 1
                OTHERS                  = 2.
    ENDFORM.
    *       FORM convert_spool_to_pdf                                     *
    FORM convert_spool_to_pdf.
      CALL FUNCTION 'CONVERT_ABAPSPOOLJOB_2_PDF'
           EXPORTING
                src_spoolid              = gd_spool_nr
                no_dialog                = c_no
                dst_device               = c_device
           IMPORTING
                pdf_bytecount            = gd_bytecount
           TABLES
                pdf                      = it_pdf_output
           EXCEPTIONS
                err_no_abap_spooljob     = 1
                err_no_spooljob          = 2
                err_no_permission        = 3
                err_conv_not_possible    = 4
                err_bad_destdevice       = 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
                OTHERS                   = 12.
      CHECK sy-subrc = 0.
    * Transfer the 132-long strings to 255-long strings
      LOOP AT it_pdf_output.
        TRANSLATE it_pdf_output USING ' ~'.
        CONCATENATE gd_buffer it_pdf_output INTO gd_buffer.
      ENDLOOP.
      TRANSLATE gd_buffer USING '~ '.
      DO.
        it_mess_att = gd_buffer.
        APPEND it_mess_att.
        SHIFT gd_buffer LEFT BY 255 PLACES.
        IF gd_buffer IS INITIAL.
          EXIT.
        ENDIF.
      ENDDO.
    ENDFORM.
    *       FORM process_email                                            *
    FORM process_email.
      DESCRIBE TABLE it_mess_att LINES gd_recsize.
      CHECK gd_recsize > 0.
      PERFORM send_email USING p_email1.
    *  perform send_email using p_email2.
    ENDFORM.
    *       FORM send_email                                               *
    *  -->  p_email                                                       *
    FORM send_email USING p_email.
      CHECK NOT ( p_email IS INITIAL ).
      REFRESH it_mess_bod.
    * Default subject matter
      gd_subject         = 'Subject'.
      gd_attachment_desc = 'Attachname'.
    *  CONCATENATE 'attach_name' ' ' INTO gd_attachment_name.
      it_mess_bod        = 'Message Body text, line 1'.
      APPEND it_mess_bod.
      it_mess_bod        = 'Message Body text, line 2...'.
      APPEND it_mess_bod.
    * If no sender specified - default blank
      IF p_sender EQ space.
        gd_sender_type  = space.
      ELSE.
        gd_sender_type  = 'INT'.
      ENDIF.
    * Send file by email as .xls speadsheet
      PERFORM send_file_as_email_attachment
                                   tables it_mess_bod
                                          it_mess_att
                                    using p_email
                                          'Example .xls documnet attachment'
                                          'PDF'
                                          gd_attachment_name
                                          gd_attachment_desc
                                          p_sender
                                          gd_sender_type
                                 changing gd_error
                                          gd_reciever.
    ENDFORM.
    *       FORM delete_spool                                             *
    FORM delete_spool.
      DATA: ld_spool_nr TYPE tsp01_sp0r-rqid_char.
      ld_spool_nr = gd_spool_nr.
      CHECK p_delspl <> c_no.
      CALL FUNCTION 'RSPO_R_RDELETE_SPOOLREQ'
           EXPORTING
                spoolid = ld_spool_nr.
    ENDFORM.
    *&      Form  SEND_FILE_AS_EMAIL_ATTACHMENT
    *       Send email
    FORM send_file_as_email_attachment tables it_message
                                              it_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.
    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.
      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[] = it_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.
    Girish

  • How can I send a MIDP through MMS??

    Hi there,
    I need to know how can I send a JAR through MMS,
    I'm not talking about WMA API..... please, understand that I don't
    want do send a MMS through JAVA or J2ME or MIDP.
    I want to send my compiled midp in a JAR, in a MMS.

    https://itunes.apple.com/us/app/id314894105?mt=8
    https://itunes.apple.com/us/app/id306273816?mt=8
    They have some limitations though. They have paid versions that remove those limitations

  • Im trying to send out a word doc and it tells me I need to set up an account with enterage. I already have my email set up with regular mail? How can I send it out through my email that is active?

    Im trying to send out a word document via email. It tells me it cannot send because I have not yet set up an account with enterage. My email is active already with Apple regular mail program. How can I send it out through reg mail?

    Save the Word document. Create your email in your normal mail application (Mail?), click on the add attachment icon (the paperclip if you are using Mail). Navigate to where you saved the Word file and select it. It should now appear as an attachment in your email. If you are sending it to a PC user and you are using Mail make sure 'Send Windows-friendly attachments' is selected in the edit menu. And if you don't want the attachment to display inline within the body of the email Control+Click on it and select 'view as icon'.

  • HT2508 My amp has an USB input but when I attach my mac pro to it, and set the input to the USB setting, no sound comes out. I looked at the system settings, but none of them produce a different outcome. How can I send the music through the USB out to USB

    My amp has an USB input but when I attach my mac pro to it, and set the input to the USB setting, no sound comes out. I looked at the system settings, but none of them produce a different outcome. How can I send the music through the USB out to USB in?

    AFAIK cameras offer their own built-in format utility for inserted SD cards.  You should use that.  Otherwise, refer to the manual that came with your camera to determine precisely how your SD cards need to be formatted to work properly.  Personally, I'd suggest Partition Scheme: MBR, and Filesystem: FAT32.
    Try to limit the number of formats you perform on the SD cards, though, as you're reducing their lifespan.  I believe formatting causes re-writes to a portion of the SD card that has fewer read/write cycles than the rest of the card as a whole.

  • How can i send a document through my email with a ipod touch 2nd generation?

    How can i send a document through my email with a ipod touch 2nd generation?

    https://itunes.apple.com/us/app/id314894105?mt=8
    https://itunes.apple.com/us/app/id306273816?mt=8
    They have some limitations though. They have paid versions that remove those limitations

  • How can i send a picture through text?

    Does anyone knows how to send a picture through text message?

    I came across this a while back and thought it was a good read
    There are some interesting challenges with MMS that do not exist with SMS:
    Content adaptation: Multimedia content created by one brand of MMS phone may not be entirely compatible with the capabilities of the recipients' MMS phone. In the MMS architecture, the recipient MMSC is responsible for providing for content adaptation (e.g., image resizing, audio codec transcoding, etc.), if this feature is enabled by the mobile network operator. When content adaptation is supported by a network operator, its MMS subscribers enjoy compatibility with a larger network of MMS users than would otherwise be available.
    Distribution lists: Current MMS specifications do not include distribution lists nor methods by which large numbers of recipients can be conveniently addressed, particularly by content providers, called Value Added Service Providers (VASPs) in 3GPP. Since most SMSC vendors have adopted FTP as an ad-hoc method by which large distribution lists are transferred to the SMSC prior to being used in a bulk-messaging SMS submission, it is expected that MMSC vendors will also adopt FTP.
    Bulk messaging: The flow of peer-to-peer MMS messaging involves several over-the-air transactions that become inefficient when MMS is used to send messages to large numbers of subscribers, as is typically the case for VASPs. For example, when one MMS message is submitted to a very large number of recipients, it is possible to receive a delivery report and read-reply report for each and every recipient. Future MMS specification work is likely to optimize and reduce the transactional overhead for the bulk-messaging case.
    Handset Configuration: Unlike SMS, MMS requires a number of handset parameters to be set. Poor handset configuration is often blamed as the first point of failure for many users. Service settings are sometimes preconfigured on the handset, but mobile operators are now looking at new device management technologies as a means of delivering the necessary settings for data services (MMS, WAP, etc.) via over-the-air programming (OTA).
    WAP Push: Few mobile network operators offer direct connectivity to their MMSCs for content providers. This has resulted in many content providers using WAP push as the only method available to deliver 'rich content' to mobile handsets. WAP push enables 'rich content' to be delivered to a handset by specifying the URL (via binary SMS) of a pre-compiled MMS, hosted on a content provider's web server. A downside of WAP push is that from a billing perspective this content is typically billed at data rates rather than as an MMS. These charges can be significant and result in 'bill shock' for consumers.
    Although the standard does not specify a maximum size for a message, 300 kB is the current recommended size used by networks due to some limitations on the WAP gateway side.

  • How can i send a image of a page by email?

    I have a kobo vox image to send to someone by email.     How can i do this?                     Can any one help?

    Hi cyasetoud,
    That really depends on the email client that you're using, but attaching a file is usually a pretty straightforward operation. For example, many use a paperclip icon for attachments. Please check the Help for your email application for information about attaching files.
    Best,
    Sara

  • How can I send picture msgs through E50

    Please help me, I dont know how to send Picture msgs through sms? can you help me?

    picture mesgs shd be mms. so, u have to have a mms activated SIM card and thats it

  • How can I send post data through nsurlrequest?

    Hi.
    I'm working on an application which needs to make requests to a php gateway. I tried many examples I found on google, but none of them worked for me.
    First I was working with GET, and it worked just fine, but now, as I need to send more complex data, GET isn't a solution anymore. I have three params to send: module which is a string containing a php class name, method: the function in the class, and params for the function which is usually an indexed array.
    The following method makes the request to the server, but for some reason, doesn't send the POST data. If I var_dump($_REQUEST) or var_dump($_POST), it turns out, the array is empty. Can somebody tell me, what am I doing wrong? Is there some kind of a sandbox, which prevents data from being sent to the? I also tried to send some random strings, which aren't json encoded, no luck. The sdk version is 5.1, and I'm using the iPhone simulator from xcode.
    If it is possible I would like to solve this problem without any additional libraries (like asihttp).
    And here is the code:
    +(NSObject *)createRequest:(NSString *)module: (NSString *)method: (NSArray *)params
        NSString *url       = @"http://url/gateway.php";
        NSData *requestData = nil;
        NSDictionary *data  = [NSDictionary dictionaryWithObjectsAndKeys:
                module, @"module",
                method, @"method",
                params, @"params",
                nil];
        NSString *jsonMessage = [data JSONRepresentation];
        NSMutableURLRequest *request = [[NSMutableURLRequest alloc] initWithURL:[NSURL URLWithString:url]];
        NSString *msgLength = [NSString stringWithFormat:@"%d", [jsonMessage length]];
        [request addValue: @"text/xml; charset=utf-8" forHTTPHeaderField:@"Content-Type"];
        [request addValue: msgLength forHTTPHeaderField:@"Content-Length"];
        [request setHTTPMethod:@"POST"];
        [request setHTTPBody: [jsonMessage dataUsingEncoding:NSUTF8StringEncoding]];
        requestData     = [NSURLConnection sendSynchronousRequest:request returningResponse:nil error:nil];
        NSString *get   = [[NSString alloc] initWithData:requestData encoding:NSUTF8StringEncoding];
        NSLog(@">>>>>>%@<<<<<<",get);
    Thank you.

    raczzoli wrote:
    I'm working on an application which needs to make requests to a php gateway. I tried many examples I found on google, but none of them worked for me.
    Why not?
    Unfortunately, you are dealing with a number of different technologies that have been cobbled together over the years. You could write a PHP server that would respond correctly to this request, but not using basic methods like the $_POST variable. PHP was designed for HTML and true forms. What you are trying to do is make it work as a general purpose web service over the HTTP protocol. You can do that, but not with the form-centric convenience variables.
    The following is a basic program that will populate the $_POST variable.
    #import <Foundation/Foundation.h>
    int main(int argc, const char * argv[])
      @autoreleasepool
        // insert code here...
        NSLog(@"Hello, World!");
        NSString  * module = @"coolmodule";
        NSString * method = @"slickmethod";
        //NSArray * params = @[@"The", @"Quick", @"Brown", @"Fox"];
        NSString * params = @"TheQuickBrownFox";
        NSString * url = @"http://localhost/~jdaniel/test.php";
        NSDictionary * data  =
          [NSDictionary
            dictionaryWithObjectsAndKeys:
              module, @"module",
              method, @"method",
              params, @"params",
              nil];
        //NSString *jsonMessage = [data JSONRepresentation];
        //NSData * jsonMessage =
        //  [NSJSONSerialization
        //    dataWithJSONObject: data options: 0 error: nil];
        NSMutableArray * content = [NSMutableArray array];
        for(NSString * key in data)
          [content
            addObject: [NSString stringWithFormat: @"%@=%@", key, data[key]]];
        NSString * body = [content componentsJoinedByString: @"&"];
        NSData * bodyData = [body dataUsingEncoding: NSUTF8StringEncoding];
        NSMutableURLRequest * request =
          [[NSMutableURLRequest alloc] initWithURL: [NSURL URLWithString:url]];
        //NSString * msgLength =
        //  [NSString stringWithFormat: @"%ld", [jsonMessage length]];
        NSString * msgLength =
          [NSString stringWithFormat: @"%ld", [bodyData length]];
        [request
          addValue: @"application/x-www-form-urlencoded; charset=utf-8"
          forHTTPHeaderField: @"Content-Type"];
        [request addValue: msgLength forHTTPHeaderField: @"Content-Length"];
        [request setHTTPMethod: @"POST"];
        //[request setHTTPBody: jsonMessage];
        [request setHTTPBody: bodyData];
        NSData * requestData =
          [NSURLConnection
            sendSynchronousRequest: request returningResponse: nil error: nil];
        NSString * get =
          [[NSString alloc]
            initWithData: requestData encoding: NSUTF8StringEncoding];
        NSLog(@">%@<",get);
      return 0;
    I have written this type of low-level server in PHP using the Zend framework. I don't know how to do it in basic PHP and wouldn't bother to learn.
    Also, you should review how you are sending data. I changed your example to send the appropriate data and content-type for the $_POST variable. If you had a server that could support something else, you could use either JSON or XML, but your data and content-type would have to match.

  • How can I send an image directly from the browser as an attachment, not a link?

    I'm wondering if there's a way-- either via some kind of add-on or a direct FF customization-- to send an image as an attachment rather than as a link? either right-clicking an image and selecting "send image" or dragging an image into a "new message" window in outlook for example merely adds a link to the image and I'd rather that the image itself was added as an attachment. this functionality is available in IE as "email picture," which is extremely useful.
    thanks for any insight here.

    It was not mentioned what the client is. If it is a browser, the image can be sent using hml img tag. If it is using streams, then u need to set content type to image/gif or image/jpg ( depending the image u r sending) using response obj.
    response.setContentType("image/gif");
    Bye...

  • How can I send a photo through messaging without using photo stream?

    Ever since I updated my phone I can't send a pic without photo streaming and not everyone has an iPhone so I can't send pics to everyone I want to/

    Well, if you have iOS 6 on your iPhone 4, and click on a photo in your photo library, then click the "share" button in the lower left, you see these options:
    Mail
    Message
    Photo Stream (OK, you don't want that one)
    Twitter
    Facebook
    [4 other options not directly related to electronic sharing]
    So I would say you have a plethora of options.

  • How can I spread an image through multiple shapes?

    I have a large image im wanting to use to do a sort of peek-a-boo through multiple small triangle shapes i've created. Is there a way to do this?

    Select all your shapes, and choose: objects > paths > make compound path. Then you can place your photo into the compound path and it will span all the shapes.

  • How can i send digital signal through IO card to a trigger box

    digitial io card

    Please elaborate on the DIO card you are using, what programming environment, and further details about your application, system, platform, operating system, etc.
    Christian Loew, CLA
    Principal Systems Engineer, National Instruments
    Please tip your answer providers with kudos.
    Any attached Code is provided As Is. It has not been tested or validated as a product, for use in a deployed application or system,
    or for use in hazardous environments. You assume all risks for use of the Code and use of the Code is subject
    to the Sample Code License Terms which can be found at: http://ni.com/samplecodelicense

  • How do I send an attachment through email

    How can I send an attachment through email.

    This is not a firefox problem, but see analytical information in this link:
    [http://www.ehow.com/how_4942_send-e-mail.html How to Send an E-mail Attachment]
    thank you
    Please mark "Solved" the answer that really solve the problem, to help others with a similar problem.

Maybe you are looking for

  • Xfce4 with three ATI 7970 but only one monitor

    Hi everybody, I'm running xfce4 and I have 3 of those graphic cards installed to do opencl computing on them. As I wasn't able to run the Intel driver and the ATI driver in parallel I've connected my monitor to one of the ATI cards. This works well a

  • Master data from 2 source systems

    hi i am loading 2 cubes from 2 different source system 1 is ECC and another is Flat file load from Old system which is no longer in use... now cube1 has Customer records as it is manitained in ECC system cube 2 has Customer records which exists in EC

  • Compressing project to target file size (10MB)

    I have a short (around 1 min) project. I want to export it as an MPEG-4 that is under 10MB. I've tried two options in Compressor: 40kbps and 800kbps. These resulted in a 900kb file and a 13MB file, respectively. Obviously, the first one had very low

  • App Store in IPad not connecting

    Hello, my app store nor my itunes is connecting to the server. I have updated my credit card information. Any help is appreciated. mohammed

  • Scalar subqyery

    Hi Folks , I have a requirement wherein i need to write a sql statement .Something like select col1, col2, col3, col4, col5, (select id from is_table),-------i have to optimize this call col6, col7 from table_with_ten_million_rows I am skeptical of t