R – Sharepoint workflow Tasks attachment

sharepointworkflow-foundation

I have SharePoint state machine work flow(Visual Studio 2008) , in specific state i create task .

when user finish this task he can upload document as attachment for this task

then work flow goto another state

in second state i create new task for another user which will see the previous attachments of last task

and i try to see the properties of SPWorkflowTaskProperties to read attachment but i didn't find any thing

Best Answer

Assuming you want to get the actual attachment (as opposed to a link to the attachment) you will probably have to get it from the library directly:

http://www.binarywave.com/blogs/eshupps/Lists/Posts/Post.aspx?ID=26

From the above:

SPFolder folder = web.Folders["Lists"].SubFolders[list.Title].SubFolders["Attachments"].SubFolders[listitem.ID.ToString()];

foreach (SPFile file in folder.Files)
{
  // Something useful here
}
Related Topic