Sharepoint Forum

Ask Question   UnAnswered
Home » Forum » Sharepoint       RSS Feeds

Strange Problem - Uploadding PDF files using WSS 2.0 object model !

  Asked By: Anushka    Date: May 28    Category: Sharepoint    Views: 934

I am Uploading PDF files to Sharepoint Document library usign WSS object
Folloing is code.

But After uploading files in Document libray PDF files size changes

Original file size of abc.pdf is 3 KB after uploading it becames - 5 KB
and i cant read this pdf file because i am gettig following errror.

*Exception: \n\t Message: PDF startxref not found. The file is not a valid
PDF document.\n\t Conditional expression: false\n\t Filename :
XRefParser.cpp\n\t Function : PDFTRON::SDF::XRefParser::FindXRefOffset\n\t

*why this Happen is this changes the pdf file format or addsomethis new???
*any solution for this

* here is code i m using to upload file.


//To Upload a file to sharepoint.

FileStream PDFimgStream = PDFfile.OpenRead();

long imgLen;

imgLen = file.Length;

byte[] imgBinaryData = new byte[imgLen];


SPFile Doclibfile = DocLibFolder.Files.Add(PDFfile.Name, imgBinaryData, true);


PDFimgStream.Close(); //PDF File Releasing the objects





No Answers Found. Be the First, To Post Answer.