RadAsyncUpload in Web Farm

16 posts, 0 answers
  1. Lynne
    Lynne avatar
    25 posts
    Member since:
    Oct 2010

    Posted 27 Mar 2013 Link to this post

    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.

  2. Peter Filipov
    Admin
    Peter Filipov avatar
    1028 posts

    Posted 01 Apr 2013 Link to this post

    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.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Lynne
    Lynne avatar
    25 posts
    Member since:
    Oct 2010

    Posted 01 Apr 2013 Link to this post

    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. 

  5. Lynne
    Lynne avatar
    25 posts
    Member since:
    Oct 2010

    Posted 01 Apr 2013 Link to this post

    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.
  6. Peter Filipov
    Admin
    Peter Filipov avatar
    1028 posts

    Posted 02 Apr 2013 Link to this post

    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.
  7. Lynne
    Lynne avatar
    25 posts
    Member since:
    Oct 2010

    Posted 03 Apr 2013 Link to this post

    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!
  8. Peter Filipov
    Admin
    Peter Filipov avatar
    1028 posts

    Posted 05 Apr 2013 Link to this post

    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.
  9. Lynne
    Lynne avatar
    25 posts
    Member since:
    Oct 2010

    Posted 26 Apr 2013 Link to this post

    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.
  10. Peter Filipov
    Admin
    Peter Filipov avatar
    1028 posts

    Posted 01 May 2013 Link to this post

    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.
  11. Lynne
    Lynne avatar
    25 posts
    Member since:
    Oct 2010

    Posted 10 May 2013 Link to this post

    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.

  12. Daniel
    Daniel avatar
    9 posts
    Member since:
    Sep 2008

    Posted 05 Jun 2014 in reply to Lynne Link to this post

    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


  13. Peter Filipov
    Admin
    Peter Filipov avatar
    1028 posts

    Posted 09 Jun 2014 Link to this post

    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.

     
  14. Daniel
    Daniel avatar
    9 posts
    Member since:
    Sep 2008

    Posted 10 Jun 2014 in reply to Peter Filipov Link to this post

    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
  15. Peter Filipov
    Admin
    Peter Filipov avatar
    1028 posts

    Posted 12 Jun 2014 Link to this post

    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.

     
  16. James
    James avatar
    1 posts
    Member since:
    Jun 2013

    Posted 06 May 2015 Link to this post

    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?

  17. Peter Filipov
    Admin
    Peter Filipov avatar
    1028 posts

    Posted 08 May 2015 Link to this post

    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.

     
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017