?
Solved

Uploading an image file from through Windows Application from local to remote destination

Posted on 2012-04-12
2
Medium Priority
?
262 Views
Last Modified: 2012-05-06
Hi

I have a Windows Application, and in one of its forms there is a text filed (MyImage) that contains the path for an image file. Check attachment.

What's the code (upon clicking on the [Add] button shown in the attachment) to upload this local file into a remote server?

Note That: The remove server is on the same domain as my local machine wher I'm trying to upload the image file from, and the destination folder that I want to upload to is authenticated for "write access"  with my Active-Directory login name and password credintials only).

I want a code that doesn't use FTP, I want a one that is the same as that upload code from a web browser to a remote web server, but in my case here it's a Windows Application.
Img.png
0
Comment
Question by:alfardan
[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 20

Assisted Solution

by:BuggyCoder
BuggyCoder earned 1000 total points
ID: 37836427
Here is a sample for you:-

// Create a new WebClient instance.
WebClient myWebClient = new WebClient();

// Upload the file to the URI.
// The 'UploadFile(uriString,fileName)' method implicitly uses HTTP POST method.
byte[] responseArray = myWebClient.UploadFile(uriString,fileName);

Open in new window


Read here for more detail:-
http://msdn.microsoft.com/en-us/library/36s52zhs.aspx
0
 
LVL 83

Accepted Solution

by:
CodeCruiser earned 1000 total points
ID: 37839380
You also have this My.Computer.Network.UploadFile method

http://msdn.microsoft.com/en-us/library/dfkdh7eb(v=vs.90).aspx
0

Featured Post

How to Create Failover DNS Record Sets in Route 53

Route 53 has the ability to easily configure DNS record sets specifically for failover scenarios. These failover record sets can be configured to failover to full-blown deployments in other regions or to a static HTML page that informs your customers of the issue.

Question has a verified solution.

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

Many of us here at EE write code. Many of us write exceptional code; just as many of us write exception-prone code. As we all should know, exceptions are a mechanism for handling errors which are typically out of our control. From database errors, t…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
Suggested Courses

764 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