4 Answers, 1 is accepted
0
Hello Umar,
In particular cases, the nature of ASP.NET and IIS in particular does not permit you to use absolute paths which point outside your application. The ViewPaths and UploadPaths properties are one of these cases - you can use relative paths and/or virtual directories.
The ViewPaths and UploadPaths properties should receive as an argument an array of string paths pointing to folders that should be:
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. You need to override the StoreFile function:
protected void Page_Load(object sender, EventArgs e)
{
RadEditor1.ImageManager.ContentProviderTypeName = typeof(myprovider).AssemblyQualifiedName;
}
public class myprovider : Telerik.Web.UI.Widgets.FileSystemContentProvider
{
public myprovider(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(UploadedFile file, string path, string name, params string[] arguments)
{
//code
return base.StoreFile(file, path, name, arguments);
}
}
Best regards,
Rumen
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.
In particular cases, the nature of ASP.NET and IIS in particular does not permit you to use absolute paths which point outside your application. The ViewPaths and UploadPaths properties are one of these cases - you can use relative paths and/or virtual directories.
The ViewPaths and UploadPaths properties should receive as an argument an array of string paths pointing to folders that should be:
- a subdirectory of your web application
- a directory placed in the root of IIS - you can set this folder by using the
/ forward slash symbol, e.g.
RadEditor1.ImageManager.UploadPaths = new String []{"/Images"}; - a virtual directory of your web application that has a physical path pointing outside of your web application.
- a shared drive that is a virtual folder of your web application. You can see the following KB article for more information: 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. You need to override the StoreFile function:
protected void Page_Load(object sender, EventArgs e)
{
RadEditor1.ImageManager.ContentProviderTypeName = typeof(myprovider).AssemblyQualifiedName;
}
public class myprovider : Telerik.Web.UI.Widgets.FileSystemContentProvider
{
public myprovider(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(UploadedFile file, string path, string name, params string[] arguments)
{
//code
return base.StoreFile(file, path, name, arguments);
}
}
Best regards,
Rumen
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Susan
Top achievements
Rank 1
answered on 13 Apr 2009, 04:29 AM
Is this solution posted anywhere in VB? I have looked but cannot seem to find it.
Thanks,
Susan
Thanks,
Susan
0
Hi Susan,
You can use our online C# to VB.Net converter tool:
http://converter.telerik.com/
All the best,
Rumen
the Telerik team
Check out Telerik Trainer , the state of the art learning tool for Telerik products.
You can use our online C# to VB.Net converter tool:
http://converter.telerik.com/
All the best,
Rumen
the Telerik team
Check out Telerik Trainer , the state of the art learning tool for Telerik products.
0
Susan
Top achievements
Rank 1
answered on 13 Apr 2009, 12:15 PM
Thanks. Worked great.
Susan
Susan