Solved

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

Posted on 2012-04-12
2
261 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 250 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 250 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

Tutorials alone can't teach real engineering

So we built better training tools.

-Hands-on Labs
-Instructor Mentoring
-Scenario-Based Tests
-Dedicated Cloud Servers

All at your fingertips. What are you waiting for?

Question has a verified solution.

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

The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (http://www.ecb.europa.eu/stats/exch…
Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
If you're a developer or IT admin, you’re probably tasked with managing multiple websites, servers, applications, and levels of security on a daily basis. While this can be extremely time consuming, it can also be frustrating when systems aren't wor…
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…

696 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