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

Image Manager upload issue

1 Answer 142 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Web Developer1
Top achievements
Rank 1
Web Developer1 asked on 08 Jan 2009, 03:36 PM

Hello,

I have included the Image Manager into our Rad Editor control and can successfully set sub directories for images so that users can upload pictures to a folder and use them in the Edtior pane.

I now have a new requirement whereby i need to set the imagepaths and uploadimagepaths settings  to an image directory that is outside of the hosting web application, i.e. the hosting web application that runs the Rad editor control is called Web App A, the residing image directory to upload images to is a sub directory in Web App B. (Both Web apps are located on the same server)

I have applied a full UNC path to this external image directory,
i.e.:

 

\\servername\corporate$\images\cms_images\

 

 
However im having no luck in getting the upload image tab to be enabled in the Editor control when i click on the Image Manager.

Like i mentioned earlier i can get sub and virtual directories (pointing to an external directory outside of the app) running within the hosting application to enable the uploads tab successfully BUT due to access restrictions with certain users i need it to point to a different web application directory.  The virtual directory wont work for me as im still referencing the hosting applications name in the url which certain users wont be able to access.

Both my settings are as follows:

imagespaths="\\servername\corporate$\images\cms_images"

 

uploadimagespaths="\\servername\corporate$\images\cms_images"

This path works correctly when i run it in windows explorer and has the necessary .NET write permissions granted.

Can someone give me some guidance on this as im now a little lost.

I hope this information is clear enough.

Thanks

1 Answer, 1 is accepted

Sort by
0
Rumen
Telerik team
answered on 12 Jan 2009, 01:32 PM
Hi,

Please, review the following KB article on the subject: Uploading images and files to a Shared Drive.

Another approach is to implement your custom file system content provider that will be able to read the files for physical resources or virtual folders outside of the web application:
public class MyContentProvider : Telerik.WebControls.RadEditorUtils.FileSystemContentProvider
 {
        public MyContentProvider(HttpContext context, string[] searchPatterns, string[] viewPaths, string[] uploadPaths, string[] deletePaths, string selectedUrl, string selectedItemTag) : base(context, searchPatterns, viewPaths, uploadPaths, deletePaths, selectedUrl, selectedItemTag)
        {
        }

        public override string StoreFile(HttpPostedFile file, string path, string name, params string[] arguments)
        {
           
        }
    }

    private void Page_Load(object sender, System.EventArgs e)
    {
        RadEditor1.FileBrowserContentProviderTypeName = typeof(MyContentProvider).AssemblyQualifiedName;
    }
Best regards,
Rumen
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
Editor
Asked by
Web Developer1
Top achievements
Rank 1
Answers by
Rumen
Telerik team
Share this question
or