My application uses the RadAsyncUpload control and I just moved the app to our web farm environment and it intermittently
fails.
I believe it is because when the page posts back to the server, I execute RadAsyncUpload1.UploadedFiles[0].SaveAs
(newFilename, true) to rename the temporary file in the TemporaryFolder directory to a valid name before continuing with processing. I believe the failure occurs because the temporary file is in the TemporaryFolder on another server in the farm, so the SaveAs fails with file not found. I set the value of the TemporaryFolder property to an absolute path (i.e. d:\inetpub\wwwroot\appname\uploadedfiles) and my web.config files on both servers contain a MachineKey.
Is there anything else I need to do to make this work in a web farm? Thanks in advance.
15 Answers, 1 is accepted
Thank you for contacting us.
Straight to the point. When you are in a web farm scenario TemporaryFolder should be a shared location, because the RadAsyncUpload control uploads files on chunks and they should be assembled in the same location.
Let me know if this helps.
All the best,
Peter Filipov
the Telerik team

Hi Peter -
Can you be a little more detailed in your explanation, please.
The temporary folder on both servers in the web farm is shared (see attached screen print from one of the servers). The web.config file on each server in the farm contains the key for the temporary folder (i.e. <add key="TemporaryFolder" value="d:\inetpub\wwwroot\PLDR\Test\ClinicalResearchApp\UploadedFiles"/>). I set the value of temporary folder in my code - RadAsyncUpload1.TemporaryFolder = ConfigurationManager.AppSettings["TemporaryFolder"].ToString(); .
Are you saying the TemporaryFolder key in the web.config files on both servers in the web farm should point to the same shared location? If this is the case, then the web.config entry on both servers should look something like:
<add key="TemporaryFolder" value="\\TENHDCMTERPW1\inetpub\wwwroot\PLDR\Test\ClinicalResearchApp\UploadedFiles"/> ? Correct? When I try it this way, I get an access denied error when executing the SaveAs even though I've given
IIS_IUSER full control on the temporary folder directory.
Thanks in advance for the clarification.

I'm attaching a screen print of another error I'm receiving when trying to use "\\TENHDCMTERPW1\inetpub\wwwroot\PLDR\Test\ClinicalResearchApp\UploadedFiles" for my temporary folder.
The temporary folder should be set as you described in the second half of your post. Both servers in the web farm should point to the same shared location. E.g. - <add key="TemporaryFolder" value="\\TENHDCMTERPW1\inetpub\wwwroot\PLDR\Test\ClinicalResearchApp\UploadedFiles"/>. Could you try to set full control to everyone in the security permission of the folder and test your project again. Please clarify when the error message appears? Also try to handle the OnClientFileUploadedFailed event and send me the error message.
All the best,
Peter Filipov
the Telerik team

I set the temporary folder on all servers to the value you indicated, and gave Everyone Full Control to the temporary folder and uploads seem to be working now. I have been unable to recreate the script error I was seeing earlier, but will continue testing. Thanks for the help!
I am glad to hear that everything works fine. Let me know if you need further assistance.
Regards,
Peter Filipov
the Telerik team

I tried to move this application to our production web farm environment last night. Unfortunately, we were unable to resolve the various errors we were encountering with the upload control, so we had to rollback the changes. I will open a support ticket so I can attach screen prints of the various errors and snippets of the web.config file. I'm hoping there is a simple resolution so I don't have to revert to using the old RadUpload control which I know works in our production environment. Thanks.
I suggest to continue the thread in your support ticket.
Regards,
Peter Filipov
the Telerik team

This serves to document what I did to resolve the permissions and javascript issues in all our web farm environments. Servers in the web farms are running Windows Server 2008 R2.
1) Create a share on 1 server in the farm in the format \\servername\pathname. Set the TemporaryFolder in the web application on all servers in the farm to point to this share.
2) Give Everyone Full Control on the share.
3) Most importantly, create a separate application pool for the web application. Change the Identity on the application pool from ApplicationPoolIdentity to LocalSystem. Change web application to use the new application pool.
4) Suggestions for setting disable plug-ins or use impersonation on RadAsyncUpload control did not work, nor did adding security on the share for IIS_IUSR, Authenicated Users, or any other group.

Step 3 in Lynne's description of what she had to do really worries me. I do not want to touch my app pool identity, and I still need the radasyncupload to work in a web farm environment.
Is it possible that the UseApplicationPoolImpersonation property has been introduced to fix this issue? Can anyone confirm that the radasyncupload control will work properly, out of the box, in a web farm environment, when the Temporary Folder is pointed through the web.config to a shared location that everyone has full access to?
Thanks
Daniel
I am writing you to confirm that if you set the TemporaryFolder to be a shared location there should be no problem with the control to upload files.
Regards,
Peter Filipov
Telerik
Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

Is it possible that the UseApplicationPoolImpersonation property has been introduced to fix this issue? What is for if not this?
Thanks
Daniel
The change of the application pool is not necessary(probably it is imposed by a custom setup in the environment). We have no information from our other clients that this change is mandatory. Setting the UseApplicationPoolImpersonation property forces the code of the RadAsyncUpload to be executed under the identity of the application pool of the deployed site.
Regards,
Peter Filipov
Telerik
Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

Quick question: With this architecture isn't the server with the shared folder a single point of failure. So if server 1 goes down and the share is unavailable the load balancer will direct the users to Server 2, but the Rad Asynch Upload won't work because the share is down. Is this correct?
Your assumption is correct. In case that you want to handle the upload manually you could set DisableChunkUpload to true and use a custom handler. With this approach you will have an access to the uploaded files and store them where ever you want.
Regards,
Peter Filipov
Telerik
See What's Next in App Development. Register for TelerikNEXT.