0

I have a URI hosted on a server

http://192.161.0.45/MywebPage/Image 

Image is the name of the folder i want to upload file on that URI Please help me

Nitin Aggarwal
  • 451
  • 1
  • 7
  • 18
  • What have you tried? Can you show some code so we can see where you're getting lost. Are you trying to upload an entire folder? – Dave May 28 '13 at 11:37
  • 1
    First of all, you cannot just copy something to a http foler, you would need some acces to this, either via FTP or via direct access to the file system. With that uri alone, you will be unable to upload anything to the folder. – Ken de Jong May 28 '13 at 11:39
  • Dave I have tried few option like sharing that folder with read/write access and i have used FTP also, but i wonder if there any way that file can be uploaded via HTTP. @Ken isn't there any way we can upload file through HTTP – Nitin Aggarwal May 28 '13 at 11:47
  • HTTP is not a protocol to upload files with. If you want to upload using FTP you would need the login details for the webserver after which you can "easily" upload files to the server. You say you tried sharing the folder with read/write access. Does this mean you can directly work on the server in some way then? If so the problem might not be as hard to solve. Can you show some code as to what you have tried? – Ken de Jong May 28 '13 at 11:56

1 Answers1

0

Did you try this approach:

WebClient wc = new WebClient();
wc.UploadFile(uri, pathToLocalFile);

This question is realy close to your: Send a file via HTTP POST with C#

Community
  • 1
  • 1
Atiris
  • 2,613
  • 2
  • 28
  • 42