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

Virtual path not working

4 Answers 313 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Tijs
Top achievements
Rank 1
Tijs asked on 03 Jun 2009, 08:15 AM
Hello,

I am using a virtual path to load and store my images. I can view this url in my browser to get a list of the directory contents. However, when using this url as view/delete/upload paths in my ImageViewer I get the following exception:

'********' is not a valid virtual path.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:

[HttpException (0x80004005): '********' is not a valid virtual path.]
   System.Web.VirtualPath.Create(String virtualPath, VirtualPathOptions options) +8855691
   System.Web.HttpServerUtility.MapPath(String path) +90
   Telerik.Web.UI.Widgets.FileSystemContentProvider.ResolveRootDirectoryAsTree(String path) +33
   Telerik.Web.UI.RadFileExplorer.BindExplorer() +139
   Telerik.Web.UI.RadFileExplorer.OnLoad(EventArgs e) +385
   System.Web.UI.Control.LoadRecursive() +50
   System.Web.UI.Control.LoadRecursive() +141
   System.Web.UI.Control.LoadRecursive() +141
   System.Web.UI.Control.LoadRecursive() +141
   System.Web.UI.Control.LoadRecursive() +141
   System.Web.UI.Control.LoadRecursive() +141
   System.Web.UI.Control.LoadRecursive() +141
   System.Web.UI.Control.LoadRecursive() +141
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +627

4 Answers, 1 is accepted

Sort by
0
Tijs
Top achievements
Rank 1
answered on 05 Jun 2009, 11:22 AM
Anyone? This is rather high priority.

Thanks!
0
Rumen
Telerik team
answered on 05 Jun 2009, 11:59 AM
Hi Tijs,

The default content provider of the editor's file explorer dialogs works only with virtual paths, e.g.

paths that starts with / or with ~/ (where the ~ represents the root of your web application).

Please, see the following KB article for more information: Uploading images to the server (upload tab is disabled).

Kind regards,
Rumen
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Tijs
Top achievements
Rank 1
answered on 05 Jun 2009, 09:49 PM
Thanks for your reply.

However, I am using Server.MapPath (as requested in one of my other posts) so the path shouldn't be relative, right?
0
Lini
Telerik team
answered on 08 Jun 2009, 07:59 AM
Hello,

The server exception you posted indicates that that the default content provider for the editor dialogs is trying to use Server.MapPath() on a path that is already resolved (e.g. starts with "C:\"). The Server.MapPath() method works only with relative paths (e.g. starting with "/"). You should set the ViewPaths/UploadPaths/DeletePaths to be relative paths (starting with "/" or "~/" for application relative paths). If you need to have absolute paths in the editor dialogs, you will need to create a custom content provider for that. The default provider will only recognize relative paths.

Regards,
Lini
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Tags
Editor
Asked by
Tijs
Top achievements
Rank 1
Answers by
Tijs
Top achievements
Rank 1
Rumen
Telerik team
Lini
Telerik team
Share this question
or