I upload an SPFile to a document library, through code behind c#:
/*Using Document Library*/
File1.PostedFile.InputStream.Read(binData, 0, FileLength);
SPFolder DocumentLibrary = myWeb.Folders[ENQUIRY_ATTACHMENTS];
bool blReplace = true;
System.IO.Stream stream = File1.PostedFile.InputStream;
SPFieldLookupValue spvEnquiry = new SPFieldLookupValue(enquiry.ID, enquiry.Title);
SPFile spFile = DocumentLibrary.Files.Add(fileName, stream, blReplace);
But, when i open the file on Sharepoint screen, the Word document opens, and when I tried editing, and save, it said this file is only read only. I can only save as a new copy of file.
How do i solve this problem?
View Complete Post