lundi 20 avril 2015

Upload file to server .Net

I am using C# .net and I am trying to upload a file to my server. I am not using asp .net.

I followed This Question and it doesn't seem to work for me. On a sidenote, this question was written back in 2008.

I am using this code as shown in the question above:

File.Copy("zQn69PZUx.png", "\\\\198.57.247.152\\~shiro\\public_html\\new");
//tried this also
File.Copy("zQn69PZUx.png", "\\\\198.57.247.152\\~shiro\\new");

The error I get:

An unhandled exception of type 'System.IO.IOException' occurred in mscorlib.dll
Additional information: The network path was not found.

I also tried using my domain name and use the path like it shows up in the browser, without http:// because it complained about the format, saying its not accepted, like this: domain-name.com\\new, and still got the same error as a result.

Any ideas what I could be doing wrong, or have a better solution on how to upload a file to a server ? You can see here that the http://ift.tt/1O9iw4s path exists.

Aucun commentaire:

Enregistrer un commentaire