I am trying to convert a string of csv text to URL-format to be posted using uriEncode and httpQuery together.
I am able to post simple strings using the code below, but not an example like shown -- I suspect it might be the % signs???
Admittedly a newbie to ahk and assistance much appreciated.
Code:
#noenv
uriEncode(str)
{
; Replace characters with uri encoded version except for letters, numbers,
; and the following: /.~:&=-
f = %A_FormatInteger%
SetFormat, Integer, Hex
pos = 1
Loop
If pos := RegExMatch(str, "i)[^\/\w\.~`:%&=-]", char, pos++)
StringReplace, str, str, %char%, % "%" . Asc(char), All
Else Break
SetFormat, Integer, %f%
StringReplace, str, str, 0x, , All
Return, str
}
estring = 2010,11,5,18,0,55,"ROC177262","CPSOS - Search - Search",""2010,11,5,18,1,0,"ROC177262","Logon
status",""2010,11,5,18,1,6,"ROC177262","AT&T U-Verse CRM Customer Interaction Manager : Release 14 -
csrPG4cmem105",""2010,11,5,18,1,9,"ROC177262","AT&T Wireline - Synchronoss Technologies, Inc. - Windows Inter - \\Remote, 128-bit SSL/TLS.",""
newstring = % uriEncode(estring)
msgbox, %newstring% ;valid conversion confirmed here
html := ""
URL := "http://www.mysite.com/act_raw_upload.cfm"
POSTData := "raw_data= %newstring%"
length := httpQuery(html,URL,POSTdata)
varSetCapacity(html,-1)
#include httpQuery.ahk