Send table to PHP with HTTPService

How can I send a picture via HTTPService to a PHP script please?
If I do this:

var params: Object = new Objsect();
params.myData = myDataArray; dataArray is a var table I need to send
myService.send (params);


He's not on a table.
How can I pass the array to PHP?

You can convert the table to a string in FLEX and PHP, you can use the command "split"...

Here's example program to see if it helps u

http://flexarraytransfer.blogspot.com/

Tags: Flex

Similar Questions

  • problem with sending xml to php with URLRequest

    Okeay if someone could tell me what that is I am doing wrong? I get the following errors when I try to send the xml file to a php and write it in the xml file: #2044 Error: unhandled ioError:. Text = Error #2032: error flow.

    And my code is the following:

    Main application:

    <? XML version = "1.0" encoding = "utf-8"? >
    "" < mx:Application xmlns:mx = ' http://www.adobe.com/2006/mxml ' creationComplete = "LoadXML ()" layout = "absolute" > "
    < mx:Script source = "VieraskirjaScripti.as" / >
    < mx:DataGrid x = "10" y = "10" valueCommit = "out (event)" id = "mygrid" width = "245" height = "312" variableRowHeight = "true" > "
    < mx:columns >
    < mx:DataGridColumn headerText = "Vieraskijan merkinnät" textAlign = "center" fontFamily = "Georgia" fontSize = "15" fontWeight = "bold" = "col1" dataField >
    < mx:itemRenderer >
    < mx:Component >
    < mx:VBox >
    < mx:Text fontFamily = "Georgia" fontSize = "12" fontWeight = "normal" textAlign = "right" text = "{data.". Nimi} kirjoitti: "/ >"
    < mx:Text fontFamily = "Georgia" fontSize = "12" fontWeight = "normal" textAlign = "right" text = "{data.". Viesti} "/ >"
    < mx:Image source = "{data.". Kuva} "/ >"
    < / mx:VBox >
    < / mx:Component >
    < / mx:itemRenderer >
    < / mx:DataGridColumn >
    < / mx:columns >
    < / mx:DataGrid >
    < mx:Button = "201" x = "348" id = "Valamo" click = "LisaaUusi ()" label = "Button" / > "
    < mx:Button = "298" x = "348" label = "Save" click = "SaveXML (); grab. Text = str "/ >"
    < mx:TextArea = "263" x = "10" height = "312" width = "194" id = "grab" / >
    < / mx:Application >

    VieraskirjaScripti.as:

    ActionScript file
    Import mx.collections.XMLListCollection;
    Import mx.collections.Sort;
    Import mx.collections.SortField;
    flash.net import. *;
    import flash.events.Event;
    private var str:String;
    [Bindable]
    private var myXML:XML = new XML();

    private void LoadXML (): void {}
    var XML_URL:String = "Vieraskirja.xml";
    var myXMLURL:URLRequest = new URLRequest (XML_URL);
    myXMLURL.method = URLRequestMethod.POST;
    myXMLURL.data = myXML
    var myLoader:URLLoader = new URLLoader (myXMLURL);
    myLoader.addEventListener ("complete", xmlLoaded);
    }

    private void xmlLoaded(evtObj:Event):void {}
    var loader: URLLoader = URLLoader (evtObj.target);
    myXML = XML (loader.data);
    trace (myXML.Elements ('Merkinta'));
    mygrid.dataProvider = myXML.elements ('Merkinta');
    out (evtObj);
    }

    private void SaveXML (): void {}
    var PHP_URL:String = "Vieraskirja.PHP";
    var myPHPURL:URLRequest = new URLRequest (PHP_URL);
    myPHPURL.method = URLRequestMethod.POST;
    myPHPURL.contentType = "text/xml" ;// ' application/xml ';
    myPHPURL.data = myXML;
    var mySaver:URLLoader = new URLLoader (myPHPURL);
    mySaver.addEventListener ("complete", phpSaved);
    }
    private void phpSaved(evtObj:Event):void {}
    var Watch: URLLoader = URLLoader (evtObj.target);
    Str = saver.data;
    }
    private void LisaaUusi (): void {}
    var mychild:XML = < Merkinta >
    Pasi < Nimi > < / Nimi >
    123456789Pasi987654321 < Viesti > < / Viesti >
    Hymio02.gif < Kuva > < / Kuva >
    < Indeksi > 9 < / Indeksi >
    < / Merkinta >
    myXML = myXML.appendChild (mychild);
    trace (myGrid.DataProvider);
    mygrid.dataProvider = myXML.elements ('Merkinta');
    }

    private void sort(event:Event):void {}
    If (!) () mygrid.dataProvider == null)) {}
    var ac:XMLListCollection = XMLListCollection (mygrid.dataProvider);
    trace (AC);
    var sort: sort = new Sort();
    fate. Fields = [New, SortField ("Indeksi", true, true, true)];
    AC.sort = sort;
    AC. Refresh();
    Event.preventDefault ();
    }
    }

    N my php file:

    <? PHP
    $file = fopen ("Vieraskirja.xml", "w +") or die ("could not open XML file");
    $xmlString = $HTTP_RAW_POST_DATA;
    If (! fwrite ($file, $xmlString)) {}
    Print "error writing to an XML file.
    }
    print $xmlString. » \n » ;
    fclose ($file);
    ? >

    I just can't understand this

    EDiT: my vieraskirja test. XML looks like this:

    <? XML version = "1.0"? >
    < Vieraskirja >
    < Merkinta >
    Pasi < Nimi > < / Nimi >
    TestiViesti < Viesti > < / Viesti >
    Hymio02.gif < Kuva > < / Kuva >
    < Indeksi > 1 < / Indeksi > < / Merkinta >
    < Merkinta >
    < / Vieraskirja >

    A mistake is in your XML file. You have an additional label to at the end. It should be:



    PASI
    TestiViesti
    Hymio02.gif
    1

    But your error message looks like there is an error of path to locate your xml file or your PHP file. Make sure that the xml file is in the same directory as your swf file and also the PHP path is correct. When I tried your code on my system, it worked fine once I put the PHP path:
    var PHP_URL:String = "" http://localhost/Vieraskirja.PHP "; "

    Vygo

  • call and re - with httpservice

    Here's a strange thing, that I came across today. I have a program that requests a DB via a script called with httpservice aspx. A user clicks on a name, the tracks of the query and fills in a form with data from the database. The user can then change the information and send the form to another script that makes changes to the DB. That everything works except that when the user click again on the same name, the old information is returned. I checked the DB is being altered with the submission script. If I close the application and reopen it and reselect the user, changed data are there. Is there something I'm missing the httpservice call? I tried to set up the table used for NULL result data. I even put just a text field on the page and print the results of the query to it. It also shows old data. It seems that it's actually not rerun the query as it should, but rather taking the values of a place in memory until I close the application and reopen it. Any ideas?

    The relevant parts of my code are displayed.

    You're right... it turns out that I needed to get the POST instead of GET method. POST does not use the cache, while GET work. Thank you.

  • Send the POST request with BLOB content

    Hello

    I usually use the following structure to send the POST request with content of varchar2 and numbers

          content := '{"Original File Name":"'||V_HOMEBANNER_1_EN_NAME(indx)||'"}';
         url := 'https://api.appery.io/rest/1/db/Names'; 
          req     := utl_http.begin_request(url, 'POST',' HTTP/1.1');
          UTL_HTTP.set_header(req, 'X-Appery-Database-Id', '5f2dac54b02cc6402dbe');
          utl_http.set_header(req, 'content-type', 'application/json');
          UTL_HTTP.set_header(req, 'X-Appery-Session-Token', sessionToken);
          utl_http.set_header(req, 'Content-Length', LENGTH(content));
          utl_http.write_text(req, content);
          res := utl_http.get_response(req);
    
    
    BEGIN
      LOOP
        utl_http.read_line(res, buffer);
      END LOOP;
      utl_http.end_response(res);
    EXCEPTION
    WHEN utl_http.end_of_body THEN
      utl_http.end_response(res);
    END;
    

    And it works very well. However, now I want to send/download (jpg image) files a blob in a MongoDB collection called "Files" (so url: = ttps://api.appery.io/rest/1/db/files). The guide of the collection is the next loop as a general advice:

    curl -X POST \
      -H "X-Appery-Database-Id: 5f2dac54b02cc6402dbe" \
      -H "X-Appery-Session-Token: <session_token>" \
      -H "Content-Type: <content_type>" \
      --data-binary '<file_content>' \
      https://api.appery.io/rest/1/db/files/<file_name>
    

    But I couldn't translate this curvature in PL/SQL query. Specifically, the part (-given binary '< file_content >")

    I have these BLOB files in an Oracle table, and they are stored with their names as follows:

    File_name File_content
    PIC_1.jpgBLOB OBJECT
    PIC_2.jpgBLOB OBJECT
    PIC_3.jpgBLOB OBJECT

    My question, how to download these images in the target URL?

    After a few hours I spent on it, I got it working. My solutions is inspired by this http://blog.optiosys.com/?p=246

    Since you must send you no the (same) CLOB and BLOB files, you need just need to replace .write_text by .write_raw.

    Here is my part of work for your reference:

    content: = V_HOMEBANNER_1_EN (indx);    -blob

    file_name: = 'test.jpg ';

    URL: = "https://api.appery.io/rest/1/db/files/": file_name;

    Req: = utl_http.begin_request (url, 'POST', ' HTTP/1.1');

    Utl_http.set_header (req, 'X-Appery-database - Id', '53fae4b02cc4021dbe');

    Utl_http.set_header (req, 'X-Appery-Session-token', sessionToken);

    Utl_http.set_header (req, "content-type', ' image/jpeg");

    req_length: = DBMS_LOB.getlength (CONTENT);

    DBMS_OUTPUT. Put_line (req_length);

    -IF YOU LIMIT THE DATA UNDER 32KB MSG:

    IF req_length<=>

    THEN

    Start

    Utl_http.set_header (req, "Content-Length", req_length);

    Utl_http.write_raw (req, content);

    exception

    while others then

    DBMS_OUTPUT. Put_line (SQLERRM);

    end;

    -IF MSG DATA MORE THAN 32 KB

    ELSIF req_length > 32767

    THEN

    BEGIN

    DBMS_OUTPUT. Put_line (req_length);

    Utl_http.set_header (req, "Transfer-Encoding", "Chunked");

    While (offset<>

    LOOP

    DBMS_LOB. Read (content, amount, offset, buffer);

    Utl_http.write_raw (req, buffer);

    offset: = offset + amount;

    END LOOP;

    exception

    while others then

    DBMS_OUTPUT. Put_line (SQLERRM);

    end;

    END IF;

    l_http_response: = UTL_HTTP.get_response (req);

    Utl_http.READ_TEXT (l_http_response, response_body, 32767);

    Utl_http.end_response (l_http_response);

    I hope this helps. Good luck

  • Table 1 d with rejection of the two consecutive points

    Hello

    I have table 1 d with 10 measuring points. I treat points in pairs and according to the difference between two consecutive points, I have decision weather the two points must remain in the table or should be rejected. For example, my 1 d table looks like this: 10, 20, 30, 35, 40, 44, 50, 51, 60, 69. I calculate the difference between consecutive points by pairs: 20-10 = 10, 35-30 = 5, 44-40 = 4, 51-50 = 1, 69-60 = 9. I would like to reject the table points with the value of the gap less than 2. In my case, the points are 50, 51 and the table after the rejection should have 8 items and look like this: 10, 20, 30, 35, 40, 44, 60, 69. What is the most elegant way to do it? I'm in LabVIEW 8.6.

    Thanks in advance!

    Review your original message and your example to better understand your stated requirements.

    "I treat the couple points."

    You have to take into account only the pair of 1st and 2nd point, then don't take into account the point of 3rd and 4th pair so on and so forth.

    Never consider the 2nd to 3rd or her never consider the 4th to the 5th, so on and so forth?

    What is your table? If it is very large (1000000 points), you may need to consider other options for the use of memory and speed.

  • Unable to draw the table 1 d with a cluster of 2 items on a XY Chart

    I am unable to draw a table 1 d with a cluster of 2 items on a XY Chart. The data displayed at the entrance in the graph, but nothing is drawn. I'm trying to draw a line connecting each point generated.

    You need a registry change on the inside of loops as well.

    But beyond that, you create too complicated a structure.  You create several plots of 1 point and not a single multipoint parcel.

    See attachment for the change that works.

  • Cannot send to multiple addresses with outlook express

    Cannot send to multiple addresses with outlook express

    Hello
    even if you weren't too fourth to come up with more details on this issue, guide for the question on Outlook express here.
    If you have more specific questions, please include more details.
    http://support.Microsoft.com/kb/835830
    B Eddie

  • How can I stop Outlook Express sends several empty messages with attachments

    How can I stop Outlook Express sends several empty messages with attachments

    Not a lot of information, but CrystalBall © says:
     
    Tools | Accounts | Mail | Properties | Advanced. Uncheck the box: "Break apart messages...". ».
  • I have a question regarding windows mail. I was send and receive mail with no problems until last Thursday. I can still receive mail, but I can not send.

    / * moved from answers Feedback * /.
     
    I have a question regarding windows mail. I was send and receive mail with no problems until last Thursday. I can still receive mail, but I can not send. My email is with bellsouth.net and comes in my computer through windows Messaging.  I spent an hour and a half on the phone with bellsouth, and they say that the problem is with my windows mail.  I tried to use a restore date, and that did not help either. I will post a copy of this message, as I keep getting.  Your server suddenly put an end to the connection. The possible causes for this include server problems, network problems, or a long period of inactivity. Object 't', counts: 'mail.bellsouth.net', server: 'mail.bellsouth.net', Protocol: SMTP, Port: 25, secure (SSL): no, error number: 0x800CCC0F thanks for any help.

    Sometimes, WinMail settings get screwed up and you must remove the account and then add it back back.  Make sure first that the antivirus software not interfere (see www.oehelp.com/OETips.aspx#3).   Delete your account completely, then close WinMail.  Then compact and repair the database of WinMail (see www.oehelp.com/WMUtil/).  Add your account to mail back once again, and then make sure you have the correct settings under Tools | Accounts | Mail | Properties | Servers and | Advanced to what AT & T Specifies to WinMail (or OE).  Then see if it works.

    Steve

  • Sending a big boost with the SDK high-level examples of results in a timeout

    Hello

    I try to send a big boost with the sample of high level. I have registered my valuation Service Push Blackberry application, deployed the SDK in Tomcat on my computer, my app has added to the list of high level sample applications and tried to send a little help with a message in plain text during broadcast (to the Subscriber of "push_all").

    This resulted in an IOException caused by a timeout: "taken IOException sending message to the address URL of PPG: https://cp3520.pushapi.eval.blackberry.com/mss/PD_pushRequest.

    I have a few test:

    1. I send a simple GET request in Forefox on https://cp3520.pushapi.eval.blackberry.com/mss/PD_pushRequest which resulted in 401, so I can reach this address.

    2 I tried to reproduce the request with a Firefox plugin. Here are the contents of my application:

    Headers:

    Permission: myBase64encodedcredentials

    limit: QfgeRDy0bk3pYpCMeL8Q

    multipart/related

    Content:

    -QfgeRDy0bk3pYpCMeL8Q
    Content-Type: application/xml; Charset = UTF-8


    http://www.openmobilealliance.org/tech/DTD/pap_2.1.DTD">






    -QfgeRDy0bk3pYpCMeL8Q
    Content-Type: text/plain; Charset = UTF-8
    Push-Message-ID: bgsCVVfx6AD-1361888782229

    test
    -QfgeRDy0bk3pYpCMeL8Q-

    This resulted in a timeout.

    3 I tried the same query without the "multipart/related" header, and got this response:


    http://www.openmobilealliance.org/tech/DTD/pap_2.1.DTD">

    So I guess that it is not an authentication problem.

    Do you know what could prevent the response to be sent?

    Hello

    I finally solved the problem!

    In fact when I tried to reproduce the request I made a mistake in the headers, I put two different instead of ' Content-Type: multipart/related; Boundary = QfgeRDy0bk3pYpCMeL8Q; type = application/xml '. I tried with the firefox plugin again and get the same response as Matt told me in his private message, when tested with my credentials:

    
    http://www.openmobilealliance.org/tech/DTD/pap_2.1.dtd">http://cp3520.pushapi.eval.blackberry.com/mss/PD_pushRequest" sender-name="RIM Push-Data Service" reply-time="2013-02-27T10:48:40Z">
    

    For the serevr part I think it was because of a proxy problem, you said. I could not download the installer of linux SDK on the Blackberry site, I installed the Windows SDK on my Windows computer, and I think that Java options were not used by the server (which is strange because I put it in the Tomcat service Java options). I copied the folder of the SDK on my Linux computer, added the Java options in catalina.sh and everything worked well with the sample of high level. So I guess that the problem comes from my Java Windows Setup.

    The tricky thing, I don't really understand is the timeout for the request with bad headers.

    Now, I need to know why the app is not subscribed to the service push, but it is another problem.

    Thank you all!

    Julien

  • Cannot send the UDP datagram with device 8320 (V4.2.2.180)

    There is a post says "Cannot send the datagram UDP with JDE 4.5" to

    http://supportforums.BlackBerry.com/Rim/Board/message?board.ID=java_dev&thread.ID=14528&view=by_date...

    In the emulator of JDE4.2 it really works, but he meets the same problem in the blackberry8320 (V4.2.2.180) device, get the same java.io.IOException (detailMessage = null) to the send() operation;

    I looked in the (accessible via wifi) PC with a tool named Sockettool (it can create the client and Server TCP/UDP), it can be connected to the emulator and receive datagrams sent to the emulator, but can not be connected to device.

    Is this a problem related version too?

    Appreciate if you can share your experience with datagram connection to the device.

    Here is my code:

    Emulator: host = "udp://iport1; port2.

    Feature: host = "udp://iport1; port2 /; = wifi interface.

                    try {
                        udp_client = (DatagramConnection) Connector.open(host);
                        byte[] data = {65,66,67,68};
                        int len = data.length;
                        dg_out = udp_client.newDatagram(data, data.length);
                        udp_client.send(dg_out);
                        udp_client.close();
                }catch (Exception e) {
                        System.out.println("UDP Exception:"+e.getMessage());
                    }
    

    If the application is able to send and receive UDP traffic in the BlackBerry Simulator, but not on a BlackBerry real pocket computer the first thing to check is to check that your carrier supports.  Several carriers do not support UDP traffic or restrict to specific ports or data types.  This can cause exceptions or make it appear that the application will silently fail (carrier is just dropping packets).

  • How can I send an e-mail with Windows7 link using Internet Explorer as I used to be able to do this with Windows XP?

    When l click on file and go on Send-> the only option is a shortcut on the desktop when l want to send Web etc. page with e-mail.  I can do it the old way with Google, but l don't want 2 browsers.  Thank you.

    Hi Silleebee,

    Unlike Windows XP, Windows 7 does not include a default email Client.

    You will need to install the Windows Live Mail client or Microsoft Outlook and set it as your default for mail in CUSTOM (<>) article in Set Program Access and defaults of the computer , then restart your computer before any function send to or MailTo will become available.

    Hope this information helps and let us know if you need help. We will be happy to help you.

  • When I try to send an e-mail with attached pictures, I am told that the photos will not appear in the e-mail message.

    When I try to send an e-mail with pictures, a pop-up window appears when I hit SEND and says that the photos will not appear in the e-mail message.  How can I fix it?

    original title: e-mail problems.

    Hello

    I suggest that ask you your question on the following link.

    http://answers.Microsoft.com/en-us/windowslive

  • I want to send an email manually with the fields email drives custom object? Is this possible?

    I want to send an email manually with the fields email drives custom object? Is this possible?

    Hey,.

    Yes, however, the object record Email custom fields only fill with default values. For the custom field object Record is filled, it must be sent via the event Actions or a generating program so that he knows in which case it is associated.

    Thank you...

  • How to reduce the height of a table which is with PanelCollection and pc will find panelbox and pb is panelgridlayout and pgl is at the center of tableFirstTemplate?

    Mr President.

    How to reduce the height of a table which is with PanelCollection and pc will find panelbox and pb is panelgridlayout and pgl is at the center of tableFirstTemplate?

    Concerning

    Normally at the height of the table control you need property autoheightRows -1 and then set height in the table like this inlinestyle

    height: 300px;

Maybe you are looking for