Solved

Transfering files from a web service to a win 32 client

Posted on 2010-11-18
2
1,262 Views
Last Modified: 2012-06-21
Hello,

For demonstration purposes I would like to be able to transfer a binary file from a directory on a web server to a Win 32 client application.

Can anyone point me in the right direction.  I have seen lots of examples for .Net but i want to do this in Win32 using Delphi 2010.

I can write the application and the web service... but i am not sure about the file transfer bit over soap.

0
Comment
Question by:soozh
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 7

Assisted Solution

by:ebob42
ebob42 earned 250 total points
ID: 34164450
Take a look at SOAP attachements (assuming your server and client are both written in Delphi).

Server side:

    function GetBinaryFile: TSOAPAttachment; stdcall;

implementation:

function TSourceCode.GetBinaryFile: TSOAPAttachment;
var
  FileStream: TFileStream;
begin
    Result := TSOAPAttachment.Create;
    FileStream := TFileStream.Create(YourRemoteFileName),  fmOpenRead or fmShareDenyNone);
    Result.SetSourceStream(FileStream);
end;

Client side usage:

var
  SoapAttachment: TSoapAttachment;
begin
  try
    SoapAttachment := SourceCode.GetBinaryFile;
    SoapAttachment.SaveToFile(LocalFileName)
  finally
    SoapAttachment.Free
  end
0
 
LVL 2

Accepted Solution

by:
MaximKorobov earned 250 total points
ID: 34239189
If you mean download file from web server to your local PC, you can use included INDY internet controls.

Example with progress bar implementation: http://stackoverflow.com/questions/2184473/download-a-file-from-internet-programatically-with-an-progress-event-using-delph
0

Featured Post

Report: Liquid Web beats Amazon, Rackspace & More

A study by performance analyst firm Cloud Spectator finds that Liquid Web beats rivals Amazon, Rackspace and DigitalOcean when it comes to website and cloud application performance.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Boost your ability to deliver ambitious and competitive web apps by choosing the right JavaScript framework to best suit your project’s needs.
Australian government abolished Visa 457 earlier this April and this article describes how this decision might affect Australian IT scene and IT experts.
This tutorial walks through the best practices in adding a local business to Google Maps including how to properly search for duplicates, marker placement, and inputing business details. Login to your Google Account, then search for "Google Mapmaker…
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

738 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question