[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.dotnet.framework.remoting

forum for Visual C# develoopment

JamesK

7/21/2004 3:47:00 PM

Pardon the interuption,

1. Looking for a good C# development forum?
2. Also, if anyone has come accross this problem would appreciate some help.
Having difficulty uploading a file to a Tomcat server in C#. I am using
WebClient.uploadFile(uri, image).

My code is as follows(have tried it on my own Tomcat server as well.)

WebClient Tomcat = new WebClient();

string uriString = "http://localhost/ABIDS/Files/" + photoArray[1] + ".jpg";

string fileName = @"C:\Program Files\ABIDS\Photos\" + photoArray[1] +
".jpg";

byte[] photo = GetPhoto(fileName);

byte[] responseArray = Tomcat.UploadData(uriString, photo);


I get the exception "The remote server returned an error (404) Not Found."

with regards
James


1 Answer

JamesK

7/22/2004 6:21:00 PM

0

hmmm...will need to think of another way then. Not much out there when it
comes to uploading to a server directory direct in C#. Lots of ftp programs,
but wanted a simple programmatical way using a stream or sorts. Thanks for
your reply anyways.


"JamesK" <jamesk@pacific.net.au> wrote in message
news:OSUzDuqbEHA.2840@TK2MSFTNGP11.phx.gbl...
> Pardon the interuption,
>
> 1. Looking for a good C# development forum?
> 2. Also, if anyone has come accross this problem would appreciate some
help.
> Having difficulty uploading a file to a Tomcat server in C#. I am using
> WebClient.uploadFile(uri, image).
>
> My code is as follows(have tried it on my own Tomcat server as well.)
>
> WebClient Tomcat = new WebClient();
>
> string uriString = "http://localhost/ABIDS/Files/" + photoArray[1] +
".jpg";
>
> string fileName = @"C:\Program Files\ABIDS\Photos\" + photoArray[1] +
> ".jpg";
>
> byte[] photo = GetPhoto(fileName);
>
> byte[] responseArray = Tomcat.UploadData(uriString, photo);
>
>
> I get the exception "The remote server returned an error (404) Not Found."
>
> with regards
> James
>
>