?
Solved

Transfering files from a web service to a win 32 client

Posted on 2010-11-18
2
Medium Priority
?
1,288 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 1000 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 1000 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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

Australian government abolished Visa 457 earlier this April and this article describes how this decision might affect Australian IT scene and IT experts.
When it comes to security, close monitoring is a must. According to WhiteHat Security annual report, a substantial number of all web applications are vulnerable always. Monitis offers a new product - fully-featured Website security monitoring and pr…
Viewers will get an overview of the benefits and risks of using Bitcoin to accept payments. What Bitcoin is: Legality: Risks: Benefits: Which businesses are best suited?: Other things you should know: How to get started:
This tutorial demonstrates how to identify and create boundary or building outlines in Google Maps. In this example, I outline the boundaries of an enclosed skatepark within a community park.  Login to your Google Account, then  Google for "Google M…
Suggested Courses

801 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