thread184-1791567
Hi Sir Marco,
sorry i am new here.
i tried your code in uploading file via http url but i am unable to make it work.
status returns 200 but no file was uploaded. Did i miss something. pls help
#DEFINE crlf CHR(13)+CHR(10)
strFile="C:\Downloads\RSL6952.PDF"
boundary='--'+STRTRAN(SYS(2015),'_','')
content=FILETOSTR(strFile)
contentname="file1"
strFn=JUSTFNAME(strFile)
API_URL="
cPayload=m.boundary+crlf
cPayload=cPayload+'Content-Disposition: form-data; name="'+m.contentname+'"; filename="'+strFn+'"'+crlf+crlf
cPayload=cPayload+m.content+crlf
cPayload=cPayload+m.boundary+crlf
qPayload=CREATEBINARY(m.cPayload)
oHTTP=CreateObject("MSXML2.ServerXMLHTTP.6.0")
oHTTP.Open("POST",API_URL, .f.)
oHTTP.setRequestHeader("content-type","multipart/form-data; boundary="+SUBSTR(m.boundary,3))
oHTTP.Send(m.qPayLoad)
Hi Sir Marco,
sorry i am new here.
i tried your code in uploading file via http url but i am unable to make it work.
status returns 200 but no file was uploaded. Did i miss something. pls help
#DEFINE crlf CHR(13)+CHR(10)
strFile="C:\Downloads\RSL6952.PDF"
boundary='--'+STRTRAN(SYS(2015),'_','')
content=FILETOSTR(strFile)
contentname="file1"
strFn=JUSTFNAME(strFile)
API_URL="
cPayload=m.boundary+crlf
cPayload=cPayload+'Content-Disposition: form-data; name="'+m.contentname+'"; filename="'+strFn+'"'+crlf+crlf
cPayload=cPayload+m.content+crlf
cPayload=cPayload+m.boundary+crlf
qPayload=CREATEBINARY(m.cPayload)
oHTTP=CreateObject("MSXML2.ServerXMLHTTP.6.0")
oHTTP.Open("POST",API_URL, .f.)
oHTTP.setRequestHeader("content-type","multipart/form-data; boundary="+SUBSTR(m.boundary,3))
oHTTP.Send(m.qPayLoad)