惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

酷 壳 – CoolShell
酷 壳 – CoolShell
T
Threatpost
Latest news
Latest news
N
News | PayPal Newsroom
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
Help Net Security
Help Net Security
D
Darknet – Hacking Tools, Hacker News & Cyber Security
AI
AI
Simon Willison's Weblog
Simon Willison's Weblog
TaoSecurity Blog
TaoSecurity Blog
The Last Watchdog
The Last Watchdog
L
LINUX DO - 热门话题
Google DeepMind News
Google DeepMind News
T
Threat Research - Cisco Blogs
O
OpenAI News
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
T
The Exploit Database - CXSecurity.com
NISL@THU
NISL@THU
Application and Cybersecurity Blog
Application and Cybersecurity Blog
S
Securelist
小众软件
小众软件
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
Martin Fowler
Martin Fowler
S
SegmentFault 最新的问题
Cisco Talos Blog
Cisco Talos Blog
云风的 BLOG
云风的 BLOG
AWS News Blog
AWS News Blog
GbyAI
GbyAI
N
News and Events Feed by Topic
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
美团技术团队
Engineering at Meta
Engineering at Meta
A
About on SuperTechFans
博客园 - 三生石上(FineUI控件)
S
Schneier on Security
博客园 - 聂微东
V2EX - 技术
V2EX - 技术
T
Troy Hunt's Blog
SecWiki News
SecWiki News
S
Secure Thoughts
B
Blog RSS Feed
Hugging Face - Blog
Hugging Face - Blog
WordPress大学
WordPress大学
腾讯CDC
H
Heimdal Security Blog
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
Apple Machine Learning Research
Apple Machine Learning Research
月光博客
月光博客
www.infosecurity-magazine.com
www.infosecurity-magazine.com
P
Privacy International News Feed

博客园 - azhai

sqlserver 实现数据变动触发信息 优化网站 推荐一款UI设计软件Balsamiq Mockups ubuntu 添加公钥 ubuntu 10.10 安装 redmine 收藏常用正则表达式 - azhai - 博客园 ubuntu 10.10 安装步骤 - azhai ubuntu 搭建NAT、DHCP、VPN服务 - azhai ubuntu 10.10 网络连接消失问题解决办法 远程连接mysql超时的解决办法 ubuntu apache2 的负载均衡和反向代理 ubuntu 下的两个项目管理工具 jquery 图片轮询 netbeans 字体美化 windows7 安装 virtualbox和 ubuntu SSL on Ubuntu 8.10 Apache2 博文阅读密码验证 - 博客园 线程加载返回的XMLtoTClientDataSet delphi 开发扩展(二)
用IDHTTP 实现上传和返回XML
azhai · 2009-11-03 · via 博客园 - azhai

{idHTTP}

procedure upload;

var
  tmpWeb: TIdHTTP;
  FS: TIdMultiPartFormDataStream;
begin

  try
    tmpWeb:=TIdHTTP.Create(nil);

    FS := TIdMultiPartFormDataStream.Create;

    FS.AddFormField('postconntext', '');  //上传参数

    FS.AddFile('userfile', trim(filename), '');  //上传文件

    tmpWeb.Request.ContentType:=FS.RequestContentType;
    url:='';
    return:=tmpWeb.Post(url,FS); //tmpWeb.get(url,FS);
    if return='1' then
    begin
      showmessage('上传成功!');
    end;
  finally
      tmpWeb.Disconnect;
      FreeAndNil(tmpWeb);
      FS.Free;   
  end;

end;