开发者

sending files with TClientDataSets

How do i send files using TClientDataSet?

i am using Delphi2010

thanks

vladimir.

My appologies for the confusion, my intention is to send/tranfer pdf f开发者_JAVA百科iles from one TCLientDataSet to Onother... we are using MIDAS... thanks


If your files are saved in one of the fields of ClientDataset as BLOB data, and your ClientDataset is connected to a remote DatasetProvider using DataSnap, then just calling TClientDataset.ApplyUpdate is enough to send the changed data from client to DataSnap server.

If your ClientDataset just stores file name, and file content is not saved into database, then you should upload the file to server separately. To upload the file to server, you can define a server method which takes a stream as its parameter, and call it from your client application.

If you don't know how to add a server method to your DataSnap 2010 server, then I suggest you read Bob Swart's "Delphi 2010 DataSnap: Your data where you want it, how you want it"


I'm assuming you want to move client datasets from machine to machine. Just use TClientDataSet.SaveToFile to write it to a file, and send the file using whatever transport suits you. Use LoadFromFile on the receiver to load the CDS back. I would suspect there's a SaveToStream as well, which would allow you to write it to RAM and send it over a socket.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜