.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Post New Web Links

list attachments

Posted By:      Posted Date: September 13, 2010    Points: 0   Category :SharePoint
I've got a list and add items to them via moss2007. i can also add attachments to the list item. Can i control the permissions of an attachment on an item based on a column value? Below is what i have so far: list CR create a new item and allowed to add attachements have a column called Completed which is based on the status of another column (status) when the status column = "complete" I want to set the attachments on the item to read only.

View Complete Post

More Related Resource Links

Why List Item Attachments are read only?

I am programatically adding files to list item attachments. But when I open the file, and try to hit save, they throw a read only dialog box. int FileLength = File1.PostedFile.ContentLength; if (File1.PostedFile != null && File1.HasFile) { Stream fStream = File1.PostedFile.InputStream; byte[] contents = new byte[fStream.Length]; fStream.Read(contents, 0, (int)fStream.Length); fStream.Close(); fStream.Dispose(); myWeb.AllowUnsafeUpdates = true; SPAttachmentCollection attachments = enquiry.Attachments; attachments.Add(fileName, contents); enquiry.Update(); myWeb.AllowUnsafeUpdates = false; } What could I have missed?

Sharepoint List Attachments

Hi, I have different excel, ppt documents uploaded in the sharepoint 2007 list items. I have a major problem, when i clicked on the list item it takes me to Dispform.aspx page. There's attachments shown but when i clicked on attached files, it says "Could Not open http://xxx/abc.xsl". I am not sure why this is happening. I cant even right click on the document to save it. Issue is there on the entire list. All the documents attached in the list are broken, any suggestions please.Munna

Can I import a databse from MS Access into a SharePoint list if it contains attachments?


I have 2 issues I am trying to accomplish:

Background:  I have a SharePoint list of over 8000 entries.  This list contains Text (entries) and document attachments.  The list is approximately 400MB.  I have exported the entire SharePoint list into an Access database.  I now want to import parts of the database back into seperate SharePoint lists.

Endstate:  Break the list into seperate lists.  The seperate lists will be broken down by month.  The lists need to include all content from the original list (attachements included)

Issue 1:  Can I import only selected filtered fields into SharePoint from the Access database?

Issue 2:  Can I import the selected filtered fields to include the attachements?


Opening SharePoint List Attachments - HTTP 500 Internal Server Error


We are getting "HTTP 500 - internal server error" upon opening list attachments. The list attachments are added programmatically to the list item.

This doesn't happen for all the items in the list, but only for few items.

There is no error in the SharePoint logs and the event viewer.

Has anyone encountered this issue/error?

Column to show count of attachments uploaded for each List item in MOSS 2007


We have two requirements:

First, we need a column which shows the count of attachments that are for uploaded each item, the list structure is like below:

No. Of Files Attached Title Category Description Owner

Opening attachments to list items in SharePoint 2010



We have some sites that use lists with attachments (generally PDFs). When we click on the item and then on the attachment, we only get the option to Save or Cancel. I thought this might be related to the web applications Strict vs. Permissive setting, but it occurs even after switching the web app to permissive file handling. List attachments in Microsoft formats (word, excel) open correctly in the web apps, and PDFs in document libraries correctly show the Open option since switching the web application to permissive. Is there a way for that to affect list attachments as well?




Opening SharePoint List Attachments - HTTP 500 Internal Server Error

Hi All,


We are programmatically attaching documents/attachments to the list item through a web-part.

I'm using the below code to accomplish this. (Fileupload control is rendered in the webpart)

Stream inputStream = this.fileUploadCtrl.PostedFile.InputStream;

byte[] buffer = new byte[inputStream.Length];

inputStream.Read(buffer, 0, (int)inputStream.Length);



spListItem.Attachments.Add(this.fileUploadCtrl.PostedFile.FileName, buffer);



The attachments are getting added fine. But in some cases, only the file is attached but not the contents. when we click on the attached file name, we get the following error:


Has anyone encountered this issue? Any help is highly appreciated.



SharePoint Custom Workflows - Transfering Attachments From One List To Another?

We are trying to use a more in depth version of the Sales Lead Pipleline Template where we convert Leads to Opportuinities and then Once the Opportunity has been won it transfers the info into a Job List (Custom List) and a Work Order Assignment List (Custom Task List). We are storing the attachments related to each lead/opportuinity in the lists as well and want them to transfer with the workflow when the new list item is created after we hit the convert button. I am using SP Designer and have really modified the site and workflow but when i set the attachment settings in the workflow then return to the list and test the workflow to verify that the attachments are transfering with the rest of the data, i get an error occured on the workflow and none of the data is transfered.

Can anyone help me with this?

Adding attachments to a list with anonymous user (MOSS)


i am trying to add a list item with an anonymous user.

the list is a custom list that has enabled anonymous access and has enabled

everything works fine, but when i try to add an attachment, i get a windows login prompt!

how would i go about this then?

any help appreciated.

How to show all attachments in Allitems.aspx in the custom list?



I am very new to sharepoint and I was wondering if you could help me out with something:

I am creating a sharepoint list where I want to add a few attachments to each row, and then have the attached documents displayed in the public default view as links to the documents, instead of just the paperclip icon.

I've tried to search on how to do this, but I haven't really found anything that explains how to do this in SharePoint 2010 ... Can somebody give me a pointer?

Note: I 've seen this link that is a resolution for the SharePoint 2007 and

Ready made List Types provided by SharePoint

SharePoint provides some out of the box List Types. Some of the most used ready made list types that SharePoint provides currently are listed below:

Export SharePoint List to Excel Spreadsheet Programmatically using C#

In SharePoint applications, Custom Lists are used to store business data and Document Libraries to store the documents. But for data manupulation and analysis, Microsoft Excel provides very rich features as compared to SharePoint Lists. That's why people still loves to work on Microsoft Excel Sheets.

Dropdown list in ASP.NET - How to get value selected

am sure this must be very simple, but unforunately I can't figure it out.
I have the following code which populates the dropdown lists from the database. This works fine. Now, when the user selects a particular employee name from the list, I want to get the Employee Id of the selected employee. i.e. I need to get the "Eid" value. I can do this if the EId is loaded in the dropdown list, but in this case only the employee name is displayed. Please let me know howI can get the Eid value even though it is not loaded in the dropdown list.
I would really appreciate your help

Creating Sites/Lists/List Items under Current User Context in SharePoint By Using SPUserToken

Usually we do this by performing the action under RunWithElevatedPrivileges method and updating the listitem using SPListItem.SystemUpdate() method (see here). but this approach has its own flaws like (RunWithElevatedPrivileges will run under system account, we cannot use SystemUpdate for SPSite,SPWeb,SPList, since it runs under system we will "CreatedBy" by as SystemAccount).

Editable Gridview with Textbox, CheckBox, Radio Button and DropDown List

This is an example of an editable gridview containing different ASP.NET controls. When user wants to edit values in gridview, she/he can use these controls to edit existing values in Gridview Edit Mode.

Using the Code

SmtpClient and Locked File Attachments

Got a note a couple of days ago from a client using one of my generic routines that wraps SmtpClient. Apparently whenever a file has been attached to a message and emailed with SmtpClient the file remains locked after the message has been sent. Oddly this particular issue hasn't cropped up before for me although these routines are in use in a number of applications I've built.

Get pixel format, raw format, property id list and property items image in VB.net - C#.net.

n this simple article you will learn that how we can get pixel format, raw format, property id list and property items image in VB and C#.net.

Get Pixel Format:

Image consists of pixels to get the format of the pixel we have a property named pixel format. This property returns an enumeration of pixel format. This enumeration tells the pixel format.

To demonstrate make a window application. Drag one button and a picture box on form.

Now write the following code on Button click event:
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend