1. It is mentioned in the video that the ScratchArea folder is not required to chunk the files if we have enabled RBS.
How it differs, where does the chunk data of the large file goes if we are not using / creating the folder.

2. If i have a scenario where i am using the RBS feature of SharePoint 2010 only for files more than 10MB, in such a scenario how can i or where to put the if condition that if the file is less than 10 MB use the ScracthArea folder to chunk the large file . How we can achieve such a scenario?

3. In the video there is a mention about the this.Request.Form["RadUAG_fileName"]. Now if the file is uploaded from 3-4 browsers by different users, how the file names will be?

4. If we are enabling the RBS , whether the uploadhandler.ashx is required. How different the project (Server Project-SharePoint Empty Project) will be in structure if we are using of have a facility to switch RBS and non-RBS implementation depending upon the size of the file.

5. this video shows the silverlight webpart which is deployed to the SharePoint Page to upload the file. What if i have a silverlight application which is out of SharePoint environment, hosted in some other server. I want to upload a huge file from the silverlight application to the SharePoint Document Library.

Thanks in advance.
Veena R

Tina Stancheva

Since this video is using old version of the RadUpload control, you might have to reconsider some of its logic. Basically with the last version of the control one upload request (i.e. one chunk) can contain multiple files and this means that there were some changes introduced in the RadUploadHandler implementation. More info you can find here. However, the main point of the video is still valid but you can implement it with a slightly different piece of code. I will get to that later. First let me get to your questions in the order you posted them:

1. The ScratchArea folder is used to set the RadUpload TargetFolder property - The TargetFolder should point to the folder that is configured to accept the uploaded files. If no such folder is defined the files will be uploaded directly to the server. This is why defining a TargetFolder as the ScratchArea folder in this example, allows you to track the physical path of the uploaded files. This will help you easily access them later on in your implementation and place them in a SharePoint library. However, if you are using the RBS feature then the files will be automatically stored in the physical folder that you have defined for the feature. And you can use this folder to access the uploaded files once they are entirely uploaded. So basically the ScratchArea folder helps you locate and use the uploaded files to save them to a SharePoint library.

2. You can place such an "if statement" in the RadUpload.UploadStarting() event handler (read more about the RadUpload events). You can evaluate the SelectedFile.Size to determine the TargetFolder. If the size of the selected file is less than 10MB you can set the RadUpload.TargetFolder property to ScratchArea, else you don't have to define a TargetFolder.

3. In the latest version of the RadUpload control you cannot get a parameter value using this syntax - this.Request.Form[key];. Instead you can get the name of the file using the GetFileName() method of the RadUploadHandler. Also since your scenario requires to upload multiple files with the same name but uploaded from different users, you can use the approach described here.
4. The UploadHandler is required to handle the requests sent from the RadUpload control. This is why the setup of the SharePoint sever won't change the RadUpload-related structure of the project. Even when RBS is enabled, you will still need an http handler that derives form the RadUploadHandler to listen to the requests sent from the RadUpload control on the client-side. Moreover, the RadUploadHandler implementation allows you to customize the handler to better fit your requirements (read more).
5. You should be able to implement this scenario out-of-the-box. Basically on the client side you need to define a path to the UploadHandler that will handle the upload request on the server. This is why if you can access the UplaodHandler on the SharePoint server from the server where the SL application is hosted, you should be able to use it to handle the uploads. However, cross domain issues might arise so you need to apply a proper cross-domain policy.

Finally, with the latest version of the RadUpload control it is better to modify the UploadHandler by overriding the SaveChunkDate() method instead of the ProcessStream() method:

Progress, Telerik, and certain product names used herein are trademarks or registered trademarks of Progress Software Corporation and/or one of its subsidiaries or affiliates in the U.S. and/or other countries. See Trademarks or appropriate markings.