I trying to take an image file which is present in some folder of local machine and trying to load it inside a server.

If i give the path its trying to access the server path,not the local machine's path where the actual file is present, this works fine when apllication is running in the same machine.

How can i copy/cut the local machine files where the application is being accessed to the server where the application is running?

Hello,

Couple of questions...

  1. What type of control(s) are you using to allow the user to upload a file?
  2. What type of application is running? Website, Console, etc.
  3. Is your server accessible to anyone or is it secured (hopefully secured)?

Are you using web controls or realy code? :-P

As a developer who started in C then migrated to C++ then to C# I tend to avoid as many of the built in controls MSFT offers with the .Net runtime. My suggestion to you is either

A) Use remoting (it's amazingly powerful) if this is a desktop application

or

B) Use a <form> with an <input type="file"> if it's a web page. On the web page you'll need to look at the Request.Files object in the codebehind, then save the file to disk before accessing it.

Hello,

Couple of questions...

  1. What type of control(s) are you using to allow the user to upload a file?
  2. What type of application is running? Website, Console, etc.
  3. Is your server accessible to anyone or is it secured (hopefully secured)?

Thanks for the reply i'm able to do it now.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.