Click here to Skip to main content
15,887,746 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

I want to create an application for uploading a file in a SmartClient by C#. Can anybody help me? I am struggling big time. I need to upload files (media files) to a remote server.
Posted
Updated 1-Mar-10 10:23am
v3

Hi Good Evening Sir...


Do not Worry.. Whatever I know i am telling you about upload file..

there is FileUpLoad Control in Asp.net Use this to upload file.. i am giving you a example of upload :

fileuplaod1.saveAs(server.mapPath(~Img//)+fileuplaod1.filename.tostring());
 
Share this answer
 
It hurt me since last 2 weeks..but atlast i found it..

For uploading from smart client(desktop application)...

string path = "http://devserver1/HtmlTest/UploadMedia/";
string fileName = System.IO.Path.GetFileName(textBox1.Text);
Uri uri = new Uri(path+fileName);
WebClient client = new WebClient();
client.UploadFile(uri,"PUT", fileName);
MessageBox.Show("Uploded..");

After that check the following... MOST IMPORTANT
Under IIS, expand the Web Service Extensions. There is a WebDAV service extension. Check whether it is "allow"ed or not..if not then make it ALLOW.

enjoy..
 
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