Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I am trying to attach files to a list item through a sandboxed visual web part programatically. Tried the following options

  1. SharePoint Attachments control: Not available for sandboxed solution

  2. File Upload Control to attach a file. File Upload control does not work in sandboxed web part

  3. Attaching files through ECMASCRIPT for a list item. ECMASCRIPT cannot attach files. It only reads\add\delete\update site data. File operations are not available in ECMASCRIPT

Please help me? I am in need of this immediately...

share|improve this question

1 Answer 1

Here is something I previously bookmarked for uploading via the Client OM, this code should be Sandbox compatible.

http://blogs.msdn.com/b/sridhara/archive/2010/03/12/uploading-files-using-client-object-model-in-sharepoint-2010.aspx

share|improve this answer
    
I found the first method did not work for me until I added a context.Load(docs); between lines 10 and 11. –  Saikiran Sheshagiri Sep 8 '11 at 6:40

Your Answer

 
discard

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.