This is a migrated thread and some comments may be shown as answers.

RadAsyncUpload in Web Farm

15 Answers 240 Views
AsyncUpload
This is a migrated thread and some comments may be shown as answers.
Lynne
Top achievements
Rank 1
Lynne asked on 27 Mar 2013, 04:40 PM
Hi,

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

Sort by
0
Peter Filipov
Telerik team
answered on 01 Apr 2013, 07:56 AM
Hi Lynne,

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
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
0
Lynne
Top achievements
Rank 1
answered on 01 Apr 2013, 03:22 PM

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. 

0
Lynne
Top achievements
Rank 1
answered on 01 Apr 2013, 05:04 PM
Hi Peter -

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.
0
Peter Filipov
Telerik team
answered on 02 Apr 2013, 10:04 AM
Hi Lynne,

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
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
0
Lynne
Top achievements
Rank 1
answered on 03 Apr 2013, 02:02 PM
Hi Peter -

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!
0
Peter Filipov
Telerik team
answered on 05 Apr 2013, 10:24 AM
Hello,

I am glad to hear that everything works fine. Let me know if you need further assistance.

Regards,
Peter Filipov
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
0
Lynne
Top achievements
Rank 1
answered on 26 Apr 2013, 02:34 PM
Hi Peter,

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.
0
Peter Filipov
Telerik team
answered on 01 May 2013, 09:56 AM
Hello Lynne,

I suggest to continue the thread in your support ticket.

Regards,
Peter Filipov
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
0
Lynne
Top achievements
Rank 1
answered on 10 May 2013, 01:19 PM

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.

0
Daniel
Top achievements
Rank 1
answered on 05 Jun 2014, 08:20 AM
Hi Lynne and Peter,

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


0
Peter Filipov
Telerik team
answered on 09 Jun 2014, 08:36 AM
Hi 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.

 
0
Daniel
Top achievements
Rank 1
answered on 10 Jun 2014, 06:44 AM
Thanks Peter - but please can you explain why Lynne needed to change the identity of the app pool to LocalSystem? I need to make sure that I don't have to do that.

Is it possible that the UseApplicationPoolImpersonation property has been introduced to fix this issue? What is for if not this?

Thanks

Daniel
0
Peter Filipov
Telerik team
answered on 12 Jun 2014, 07:22 AM
Hi 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.

 
0
James
Top achievements
Rank 1
answered on 06 May 2015, 02:17 PM

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?

0
Peter Filipov
Telerik team
answered on 08 May 2015, 06:57 AM
Hi James,

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.

 
Tags
AsyncUpload
Asked by
Lynne
Top achievements
Rank 1
Answers by
Peter Filipov
Telerik team
Lynne
Top achievements
Rank 1
Daniel
Top achievements
Rank 1
James
Top achievements
Rank 1
Share this question
or