http post 文件
Http = CreateObject("MSXML2.XMLHttp")Http.Open("Post","https://xxx.api",.F.)
Http.setRequestHeader("Content-Type","multipart/form-data;boundary=123456789")
lcpost = '--123456789'+chr(13)+chr(10)
lcpost = lcpost +'Content-Disposition: form-data; name="doc_title"'+chr(13)+chr(10)+chr(13)+chr(10)
lcpost = lcpost +'001'+chr(13)+chr(10)
lcpost = lcpost +'--123456789'+chr(13)+chr(10)
lcpost = lcpost +'Content-Disposition: form-data; name="doc_type"'+chr(13)+chr(10)+chr(13)+chr(10)
lcpost = lcpost +'1'+chr(13)+chr(10)
lcpost = lcpost +'--123456789--'+chr(13)+chr(10)
Http.send(lcpost)
cfhxx = Http.ResponseText
*****************************************************
lcpost = lcpost + lcmsg_digest+CHR(13)+CHR(10)
lcpost = lcpost + '--GF3H7G2YU1JH74GTRF'+CHR(13)+CHR(10)
lcpost = lcpost + 'Content-Disposition: form-data; name="file"; filename="/D:/xxx/合同文件.pdf"'+CHR(13)+CHR(10)
lcpost = lcpost + 'Content-Type: application/pdf'+CHR(13)+CHR(10)+CHR(13)+CHR(10)
lcpost = lcpost + lcfiledata +CHR(13)+CHR(10)
lcpost = lcpost + '--GF3H7G2YU1JH74GTRF--'+CHR(13)+CHR(10)
如果上传文件呢?这里的lcfiledata的编码格式又是什么呢?filetostr('合同文件.pdf')上传成功,但后台是空白pdf文件。 求解?