Solved

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

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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

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…
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…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

708 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now