Upload file to NON WCF web service

joneden

Active Member
Licensed User
Longtime User
Hi All,

I'm trying to upload a file or byte array to a standard .net webservice - not a WCF one. It's an existing web service with loads of functionality that would break if I change to WCF.

I've been looking at examples of how to use the HttpUtils2 lib to PostFile or PostBytes. I can get all of that done but on the web service side of things I can't find out how to receive the file. Looking at it PostFile seems to use PostBytes behind the scenes so I'm really just focusing on that front.

I'm used to doing a web service with the PostString method like this:
Public Function Upload(ByVal input as String, ByVal input2 as string)

How do you do it with the PostBytes method?

I've been searching and searching and before my hair falls out I thought I may as well take the last resort and post the question.

Thanks for any help.

Jon
 

joneden

Active Member
Licensed User
Longtime User
Hi Erel,

That's the thing.

At the moment I don't know how to take the byte array at the web service end. I'm fine with variables done with the PostString method but don't know what to do at the other end with the PostBytes method...

I've literally just stumbled over a comment where you say to use Request.InputStream to read the bytes into a file. I'll have a look into that and let you know if I have a problem.

Best Regards,

Jon
 
Upvote 0

joneden

Active Member
Licensed User
Longtime User
Hi Erel,

I've just posted the method that I used into the tutorial forum in case others have the same issues.

Cheers,

Jon
 
Upvote 0
Top