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
Solved

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

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

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

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

Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

856 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