Tell me more ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I Have Created an Fileupload with the following code.

 if (FileUpload_Pic.PostedFile != null && FileUpload_Pic.HasFile)
                        {
                            Stream fStream = FileUpload_Pic.PostedFile.InputStream;

                            byte[] contents = new byte[fStream.Length];
                            fStream.Read(contents, 0, (int)fStream.Length);
                            fStream.Close();
                            fStream.Dispose();

                            SPAttachmentCollection attachments = item.Attachments;
                            string fileName = Path.GetFileName(FileUpload_Pic.PostedFile.FileName);
                            attachments.Add(fileName, contents);

                            //listItem["Attached FileName"] = fileName; // store the name of the file in a column for future requirements
                            item.Update();
                        }

That saves an picture attachments to an SPlist I Have also created an Textbox there i search in the SPList for the ProductsNumber , but would also like to add an attachments in the listbox , but i dont really know , how to make it...

share|improve this question

Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.