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

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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

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

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


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.