Forum Discussion

btpoole's avatar
btpoole
Channel Surfer
8 years ago

Send roarray to server

Trying to pass a roarray to my server thru the url. I can do string with no problem but getting a type mismatch when setting the url. Looks something like

serverurl="http://myserver/myserversecript.php?filename="+myfile+"&myarray="+myarray

I can use the same code and include and send one element of the array as a string and works fine

serverurl="http://myserver/myserversecript.php?filename="+myfile+"&myarray="+myarray[0].title

Can the entire array be sent at one time. Thought about looping thru myarray but thought there had to be another way to avoid making so many calls.

2 Replies

  • I would do something like this:
    ut = CreateObject("roUrlTransfer")
    myfileEscaped = ut.Escape(myfile)
    myarrayJson = FormatJson(myarray)
    myarrayJsonEscaped = ut.Escape(myarrayJson)
    serverurl="http://myserver/myserversecript.php?filename="+myfileEscaped+"&myarray="+myarrayJsonEscaped
  • btpoole's avatar
    btpoole
    Channel Surfer
    "belltown" wrote:
    I would do something like this:
    ut = CreateObject("roUrlTransfer")
    myfileEscaped = ut.Escape(myfile)
    myarrayJson = FormatJson(myarray)
    myarrayJsonEscaped = ut.Escape(myarrayJson)
    serverurl="http://myserver/myserversecript.php?filename="+myfileEscaped+"&myarray="+myarrayJsonEscaped


    Thanks belltown, this worked.