| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 1163 人关注过本帖
标题:http post 文件
只看楼主 加入收藏
radiofan
Rank: 7Rank: 7Rank: 7
等 级:贵宾
威 望:11
帖 子:466
专家分:696
注 册:2006-7-30
结帖率:76.47%
收藏
 问题点数:0 回复次数:0 
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文件。 求解?
搜索更多相关主题的帖子: name pdf http 文件 post 
2020-11-05 16:28
快速回复:http post 文件
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.019356 second(s), 11 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved