Pb with post upload the XML file, return to the request was rejected because no multipart boundary, how to solve?
Here is my code:
Dom=CREATE OLEObject
HTTP=CREATE OLEObject
//messagebox debugging to see if success
Ls_FileName='c: \ L5 XML'
Ll_rc=HTTP. ConnectToNewObject (" Microsoft. XMLHTTP ")
IF ll_rc & lt; 0 THEN
MessageBox (" connection XMLHTTP error ", "error number:" + String (ll_rc))
DESTROY the dom
DESTROY the HTTP
The return - 1
The else
Ll_rc=dom. ConnectToNewObject (" MSXML2. DOMDocument ")
If ll_rc & lt; 0 then
DOMDocument MessageBox (" connection error ", "error number:" + String (ll_rc))
DESTROY the dom
DESTROY the HTTP
The return - 1
End the if
//upload begins
The dom. The Load (ls_FileName)
HTTP. Open (" POST ", as_URL, true)
Http. SetRequestHeader (" the content-type ", "multipart/form - the data")
HTTP. Send (dom) XML)
The do While HTTP. ReadyState & lt;> 4//query state, delay
The yield ()
Loop
As_ret=HTTP. The responseText
CodePudding user response:
refer to the original poster wang_jzh response: pb with post upload an XML file, return to the request was rejected because no multipart boundary, how to solve? Here is my code: Dom=CREATE OLEObject HTTP=CREATE OLEObject //messagebox debugging to see if success Ls_FileName='c: \ L5 XML' Ll_rc=HTTP. ConnectToNewObject (" Microsoft. XMLHTTP ") IF ll_rc & lt; 0 THEN MessageBox (" connection XMLHTTP error ", "error number:" + String (ll_rc)) DESTROY the dom DESTROY the HTTP The return - 1 The else Ll_rc=dom. ConnectToNewObject (" MSXML2. DOMDocument ") If ll_rc & lt; 0 then DOMDocument MessageBox (" connection error ", "error number:" + String (ll_rc)) DESTROY the dom DESTROY the HTTP The return - 1 End the if //upload begins The dom. The Load (ls_FileName) HTTP. Open (" POST ", as_URL, true) Http. SetRequestHeader (" the content-type ", "multipart/form - the data") HTTP. Send (dom) XML) The do While HTTP. ReadyState & lt;> 4//query state, delay The yield () Loop As_ret=HTTP. The responseText See tips, there is no boundary should be your upload information, if only upload the XML, use PB directly bring posturl is simpler CodePudding user response:
The eldest brother have a contact number? Such as QQ, can directly ask you CodePudding user response:
Qq: 19798975 CodePudding user response:
Application requirements can only use the post "the content-type", "multipart/form - data" upload this format CodePudding user response:
To you for reference, for example, study the right PB take the method of web content String ls_get_url, ls_args String ls_response_text, ls_status_text Long ll_status_code Long ps1, ps2, ps3, ps4 String srstr1, srstr2 N_cst_string lhv_string OleObject loo_xmlhttp String ls_nj ls_deptno, ls_deptname ls_spenme, ls_temp1, ls_temp2, ls_temp3 Long isel_total=0, row, row_spe, lii, lij, li_rs, li_rsdet Ls_nj=trim (ddlb_1. Text) If ls_nj="' then Messageboxx (' prompt ', 'please select grade! 'the Information! , OK! The 1) Return End the if If dw_dept. Rowcount () & lt;=0 then return Ls_get_url="http://" + trim (sle_1. Text) + "/newcsu/common/search/classresult1 aspx" Dw_special. Reset () For row=1 to dw_dept. Rowcount () If dw_dept. Getitemnumber (row, 'isel)=1 then Isel_total + + Ls_deptno=trim (dw_dept getitemstring (row, 'departments code)) Ls_deptname=trim (dw_dept getitemstring (row, 'faculty name')) //ls_args="grade suit=% 20 & amp; DeptId=03% 20 & amp; The deptName=resources processing and biological engineering college " Ls_nj ls_args="grade=" + + ", "% 20 & amp; Ls_deptno deptId="+ +", "% 20 & amp; The deptName="+ ls_deptname Try Loo_xmlhttp=CREATE oleobject Loo_xmlhttp. ConnectToNewObject (" Msxml2. XMLHTTP. 4.0 ") Loo_xmlhttp. Open (" GET ", ls_get_url + "?" + ls_args, false) Loo_xmlhttp. The send () //Get our response Ls_status_text=loo_xmlhttp. StatusText Ll_status_code=loo_xmlhttp. Status //Check the HTTP Response code for errors If ll_status_code & gt; Then=300 Messageboxx (' prompt ', 'Web GET request failed! ~ r ~ n ~ r ~ n '+ ls_response_text, Information! , OK! The 1) The else //Get the response we received from the web server Ls_response_text=loo_xmlhttp. The ResponseText End the if Srstr1=ls_response_text Srstr2='~ t & lt;/tr> ~ r ~ n ~ t ~ t & lt; Td align="Center" & gt; ' Ps1=pos (ls_response_text srstr2, 1) If ps1=0 then the continue Srstr1=mid (ls_response_text, ps1 + len (srstr2)) Srstr1=lhv_string. Of_globalreplace (srstr1 srstr2, ' ') Srstr1=lhv_string. Of_globalreplace (srstr1, '& lt;/td> Srstr1=lhv_string. Of_globalreplace (srstr1, '& lt;/td> ', '~ t') Srstr1=lhv_string. Of_globalreplace (srstr1, '& lt;/td> ', ' ') Srstr1=lhv_string. Of_globalreplace (srstr1, '~ t & lt;/tr> ~ r ~ n & lt;/table> ~ r ~ n ~ t ~ t ~ t & lt;/form> ~ r ~ n ~ t & lt;/body> ~ r ~ n & lt;/HTML> ~ r ~ n ', ') nullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnull