Click here to Skip to main content
15,894,646 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
Hello,
I am developing a WCF service where both the client and the service exist on the same remote server and the client is accessed via a browser from uses local PC. The Service is a WCF Service Library and the client is a ASP.NET Web form application. I need the service to request that a file be uploaded from the user's Local drive (eg C:/uploads/instructions.xlmx). If the Client was running on the local machine then this would not be an issue. However because the client is on a remote server (which knows nothing about the Local PC) I am struggling with how I can go about this. The one thing to note here is that the instruction to transfer file from Local PC to remote server will always come from the service.

Appreciate any advise I can get on this. Please explain in detail as I am relatively new to this.

regards
Pat

What I have tried:

I have tried looking up similar scenarios on the web - without success. My guess is that somehow I need to upload file to the browser but not sure how of where I do this from
Posted
Updated 14-Feb-16 14:47pm
v2
Comments
Sergey Alexandrovich Kryukov 14-Feb-16 16:07pm    
Not clear what needs answer. It all depends on what is that server. Apparently, it's not too remote to the client, but it makes no diference is the server can sever up real remote clients. :-)
"Without success" is not informative. Why using the section "What I have tried" if you don't share what you tried?
—SA

1 solution

I am not sure what you mean by ".. The one thing to note here is that the instruction to transfer file from Local PC to remote server will always come from the service..."

The Web Page user needs to select the file to be uploaded - unless you are saying "there will always be a file in location C:/uploads/instructions.xlmx that needs to be uploaded". If this is the case then you would need another method of posting the file to server as a web service doesn't work that way.

If you get the User to select a file via a FileUpload control on your ASP.Net page you can then get the file as a byte array which can be sent to your WCF service.

Kind Regards
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900