checksal
February 8th, 2005, 11:34 AM
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.
//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.