Delphi unigui从数据表里下载流文件


本文整理自网络,侵删。

 
引用
Data.DB, uniGUIapplication

//从数据表里下载流文件
class function Tcommont.downfujian(fjbh, fjnm: string): boolean;
var
  sql: string;
  fs: TMemoryStream;
begin

  fs := TMemoryStream.Create;
  sql := 'select fileid,file from tbfile where fileid=' + QuotedStr(fjbh);
  UniMainModule.tbfile_q.Active := false;
  UniMainModule.tbfile_q.SQL.Text := sql;
  UniMainModule.tbfile_q.Active := true;

  try
    TBlobField(UniMainModule.tbfile_q.FieldByName('file')).SaveToStream(fs);
    UniSession.SendStream(fs, fjnm); //保存文件名fjnm
  except
  end;

  fs.Free;
  UniMainModule.tbfile_q.Active := false;

end;
――――――――――――――――

原文链接:https://blog.csdn.net/ozhy111/article/details/83339620

相关阅读 >>

Delphi过程函数传递参数的八种方式

Delphi利用getprocessmemoryinfo获取进程占用内存大小

Delphi enumwindows回调函数获取qq2009窗体句柄

Delphi如何删除数据库重复记录(4种方法)

Delphi xe datasnap服务器获取客户端ip地址

Delphi中的strpas功能

Delphi 让程序只运行1次

Delphi 的webbrowser如何全选并复制浏览器上的文字

Delphi生成guid

Delphi 模拟按键的一些误解

更多相关阅读请进入《Delphi》频道 >>



打赏

取消

感谢您的支持,我会继续努力的!

扫码支持
扫码打赏,您说多少就多少

打开支付宝扫一扫,即可进行扫码打赏哦

分享从这里开始,精彩与您同在

评论

管理员已关闭评论功能...