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

Image manager remote folder

3 Answers 110 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Charlie
Top achievements
Rank 1
Charlie asked on 06 Oct 2015, 11:38 AM

Hi I have been trying to get the image manager (within the RadEditor) working correctly within my application but with no luck. I am trying to use a shared folder as the path for the images using a virtual folder configured in IIS but again with no luck but I don't understand why not. I have followed every guide I could find on this site but none of these seem to work. I have successfully configured the virtual directory and the account running the web page has access to the folder as I have used the following code and tried to change the folder to somewhere else and that gave me the javascript alert but my current setup does not.

The following gives no error but the upload button is greyed out on the deployed site.

string[] imagePath = { "/Images" };

whereas the following throws the javascript error saying it cannot access the directory but works on localhost when developing.

string[] imagePath = { "~/Images" };

private void FullPermissionsTest(string testPhysicalPath)
        {
            try
            {
                string physicalPathToTestFolder = System.IO.Path.Combine(testPhysicalPath, "TestDirectory");
                System.IO.DirectoryInfo testDir = System.IO.Directory.CreateDirectory(physicalPathToTestFolder);// Create folder
                testDir.GetDirectories();// List folders
                string testFilePath = System.IO.Path.Combine(testDir.FullName, "TestFile1.txt");// test file paths
                System.IO.File.Create(testFilePath).Close();// Create a file
                testDir.GetFiles("*.*");// List files
                System.IO.File.OpenRead(testFilePath).Close();// Open a file
                System.IO.File.Delete(testFilePath);// delete the test file
                System.IO.Directory.Delete(physicalPathToTestFolder);// delete the test folder
            }
            catch (Exception ex)
            {// Show the probelm
                string message = ex.Message;
                string script = string.Format("alert('{0}');", message.Replace("'", @""""));
                ScriptManager.RegisterStartupScript(this.Page, this.Page.GetType(), "KEY", script, true);
            }
        }

 

I have attached a screenshot of the setup of my virtual folder please could someone help with this as it is currently holding up go live of a project.

3 Answers, 1 is accepted

Sort by
0
Vessy
Telerik team
answered on 06 Oct 2015, 02:16 PM
Hi Charlie,

By design RadFileExplrorer (the control used for listing files and folders inside the ImageManager) can work only with virtual paths to folders placed inside the application's root directory. This is why the not virtual path is leading to a broken control, as it is not able to access the passed data (thus the Upload button gets disabled).

Most probably the application does not have enough permissions to access this folder after deployment, so I would advice that you double check its IIS configurations. You can also try to directly navigate to the target folder (or a file inside it) though the url and see whether its content will be loaded, e.g.:
www. yourSiteName/images/sampleImage.jpeg

Regards,
Vessy
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Charlie
Top achievements
Rank 1
answered on 07 Oct 2015, 06:29 AM

Hi Vessy thank you for the reply. I have tried opening an image in the folder directly like so www. yourSiteName/images/sampleImage.jpeg and it works fine the image loads on to the page but the upload is still greyed out. I'm guessing this means that my IIS configuration must be correct if I can access the folder directly?

 

Regards

0
Vessy
Telerik team
answered on 08 Oct 2015, 12:56 PM
Hi Charlie,

In only the Upload icon is great our, or also the content of the folder is not shown(only the root folder name is displayed)? Can you add some test files to the folders and see whether you will be able to navigate through them? It will be great if you record a shor video demonstrating the exact behavior you are experiencing and send it to us so we can understand the issue better.

Please note, that if you are using the default provider of FileExplroer the ViewPaths must be set with "~" sign:
string[] imagePath = { "~/Images" };

On a side note, I would suggest that you also take a look at the shared paths and physical folders content provider given by us in the following code library, which will allow you to access such folders without bothering about IIS permissions: Use RadFileExplorer with physical and shared folder's paths

Regards,
Vessy
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
Editor
Asked by
Charlie
Top achievements
Rank 1
Answers by
Vessy
Telerik team
Charlie
Top achievements
Rank 1
Share this question
or