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

FileUploadControl.HasFile always returns false.

When I tried using HttpFileCollection

HttpFileCollection files = Request.Files;

after adding System.Web Namespace it says 'Request' does not exists in the current context.

Is there any way to use asp.net FileUpload control in sharepoint sandbox?

share|improve this question
add comment

2 Answers

up vote 1 down vote accepted

This is prohibited by the Sandbox user process and the sandboxed object model. Most properties of the ASP.NET objects (such as Page, Request, Response etc) are marshalled from the w3wp.exe process to the user code process into new "sandboxed" copies of these objects. The Request.Files property is on of those objects that is not copied. It's more of a resource issue than a security issue.

share|improve this answer
    
The requirement is to upload files to Document library from FileUpload Control, is there any other way to do this, in sandbox solution. –  Marcus Mar 27 '12 at 13:48
    
You can use a Silverlight app to achieve this. –  Wictor Wilen MCA MCM MVP Mar 27 '12 at 16:25
add comment

you can't do that because this is a security issue.

share|improve this answer
add comment

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.