|
-
February 8th, 2005, 12:34 PM
#1
Webservice not saving PDF file properly
I an working on uploading PDF files using VBS and .net c# webservice. I am converting the PDF to base64 on the vbs side and then reconverting on the server and saving. But when I try to open the files, they are empty. The following is the code used on the webservice.
//fileData is the base64 coming from the VBS
byte[] bb = System.Convert.FromBase64String(fileData);
System.IO.MemoryStream bs = new System.IO.MemoryStream(bb);
FileStream fs = new FileStream(@"C:\"+filename,FileMode.OpenOrCreate,FileAccess.Write);
fs.Close();
Please help because it is hard for a newbie like me. I do not know why the files are empty. Its baffling.
-
February 8th, 2005, 03:59 PM
#2
Re: Webservice not saving PDF file properly
You don't appear to be writing anything to the FileStream object.
Have a look at the FileStream.Write method - this should let you write the MemoryStream out to the file.
Last edited by Davey; February 8th, 2005 at 04:01 PM.
-
February 8th, 2005, 05:53 PM
#3
Re: Webservice not saving PDF file properly
Thanks Davey but the problem was on the VBS side. The c# side was also much more complex since it had to do with manupilation at the soapextention level. But the issue is solved. It was much more complex than what I was doing earlier. Thanks for everyone who helped.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|