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

ImageManager in Load-Balanced environment

3 Answers 129 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Adam Hey
Top achievements
Rank 1
Adam Hey asked on 17 Aug 2012, 12:59 PM
Hi there,
  I am using a RadEditor with an ImageManager. This worked fine when specifying paths relative to the application:
<ImageManager ViewPaths='/blogUpload/postimage/' DeletePaths='/blogUpload/postimage/'
                            UploadPaths='/blogUpload/postimage/' MaxUploadFileSize="6553600" />

But I'm unable to get it working again after I moved the site to a load-balanced environment which has a shared location for file uploads "E:\SharedFiles" 

The following syntax doesn't allow image uploads and gives 404 errors on other buttons within the ImageManager

                string[] viewImages = new string[] { "/blogupload/postimage/" };
                string[] uploadImages = new string[] { @"E:\SharedFiles\blogupload\postimage"};
                string[] deleteImages = new string[] { @"E:\SharedFiles\blogupload\postimage"};
                RadEditorContent.ImageManager.ViewPaths = viewImages;                 RadEditorContent.ImageManager.UploadPaths = uploadImages;                 RadEditorContent.ImageManager.DeletePaths = deleteImages;                 RadEditorContent.ImageManager.MaxUploadFileSize = 6553600;

I've based the above approach from this page

Is there something wrong with how I'm approaching this? The above code doesn't even work on my local machine with "C:\folder\folder\" for uploadImages and deleteImages

3 Answers, 1 is accepted

Sort by
0
Dobromir
Telerik team
answered on 22 Aug 2012, 08:37 AM
Hi Adam,

Do experience the same error every time when you upload a file or this error occurs only when uploading large files, in particular files larger than 4MBs? Could you please try to set the maxRequestLength property of the httpRuntime tag in the web.config to higher value and see if the problem still exists?

If this does not solve the problem, could you please open formal support ticket and send us sample fully runnable project reproducing the problem so we can examine and debug it locally?

Kind regards,
Dobromir
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
Adam Hey
Top achievements
Rank 1
answered on 28 Aug 2012, 05:52 AM
Hi Dobromir,
I am unable to even browse for a file. As stated, the code DID work 100% when using a relative path, but AFTER moving the site to a load-balanced environment AND changing the ViewPaths/DeletePaths/UploadPaths values to absolute ("E:\SharedFiles" ) the upload image manager is full of errors and "Upload" link is disabled (see screenshots).

The code I pasted below is from the knowledge base, so I can't understand why this doesn't work with absolute paths.

I can't give you the project, but I can supply you with login credentials to test on the staging environment. please mail me at adamh[at]aquaonline.com and I will send you all the details.

Thanks
Adam

0
Dobromir
Telerik team
answered on 30 Aug 2012, 12:17 PM
Hi Adam,

Could you please verify that you have configured the content provider applying all of the steps bellow:
  • set the path to your physical directory (if you're using one) -  You could use the already included paths - just have to move the "PhysicalSource" folder (placed in the root directory of the project) to your physical drive

    For example, if your root directory's path is E:\SharedFiles\blogupload\postimage (and you have folders named Upload, Delete and ..), your ViewPaths should be set in this way: @"E:\SharedFiles\blogupload\postimage"
  • set the path to your shared directory - look at all paths, which includes telerik.com:
    string[] viewPaths = new string[]
        {
            @"E:\SharedFiles\blogupload\postimage",
        };
      
    string[] uploadPaths = new string[]
        {
            @"E:\SharedFiles\blogupload\postimage",
        };
      
    string[] deletePaths = new string[]
        {
            @"E:\SharedFiles\blogupload\postimage",
        };
  • Open MappingFile.mapping (you could find it in "~\App_code") and apply modifications to the mappings:
    <Mapping>
      <PhysicalPath>
        <![CDATA[E:\SharedFiles\blogupload\postimage]]>
      </PhysicalPath>
      <VirtualPath><![CDATA[MySharedRootDir/]]></VirtualPath>
    </Mapping>


Also, while reviewing the code snippets provided in the initial post I noticed that the ViewPaths and the UploadPaths and DeletePaths values differ in formatting. Please note that when using this content provider the values that you need to set to the ViewPaths/UploadPaths/DeletePaths properties should be the physical path to the folder (E:\SharedFiles\blogupload\postimage).

Regarding the case with providing confidential information (i.e. login credentials to the staging server) you can either open a formal support ticket (which is not public) or send them to client.service@telerik.com and notify that the information is related to this forum thread.

All the best,
Dobromir
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.
Tags
Editor
Asked by
Adam Hey
Top achievements
Rank 1
Answers by
Dobromir
Telerik team
Adam Hey
Top achievements
Rank 1
Share this question
or