Hi tech geeks,
I want to upload a document through the following code in the sharepoint document library
The issue is that the code work fine but i just want an addtitional sting parameter to be passed with the method say liitle descrptn abt file and also want to retrive the same while i will show the files in the gridview
So i just want to know that how to pass an addtional string paratemer
as these are all sharepoint methods i can modify it and same time i want to use the byte stream only
Some one kindly help
if (FileUpload1.PostedFile.ContentLength > 0)
{
System.IO.Stream strm = FileUpload1.PostedFile.InputStream;
byte[] byt = new byte[
Convert.ToInt32(FileUpload1.PostedFile.ContentLength)];
strm.Read(byt, 0, Convert.ToInt32(FileUpload1.PostedFile.ContentLength));
strm.Close();
SPSite site = new SPSite(SPContext.Current.Site.Url);
SPWeb objWeb = site.OpenWeb();
SPFolder mylibrary = objWeb.Folders["UploadedDocs"];
objWeb.AllowUnsafeUpdates = true;
SPFile file = mylibrary.Files.Add(System.IO.Path.GetFileName
(FileUpload1.PostedFile.FileName), byt, SPContext.Current.Site.RootWeb.CurrentUser, SPContext.Current.Site.RootWeb.CurrentUser, System.DateTime.Now, System.DateTime.Now);
}