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...

1 Answer 1


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


  • I found the first method did not work for me until I added a context.Load(docs); between lines 10 and 11. Commented Sep 8, 2011 at 6:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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