Provides storage independent mechanism for uploading files and populating the content of the FileBrowser dialog controls.
Definition
Namespace:Telerik.Web.UI.Widgets
Assembly:Telerik.Web.UI.dll
Syntax:
public abstract class FileBrowserContentProvider
Inheritance: objectFileBrowserContentProvider
Derived Classes:
Inherited Members
Constructors
protected FileBrowserContentProvider()
Creates a new instance of the class. Used internally by FileManager to create instances of the content provider.
protected FileBrowserContentProvider(HttpContext context, string[] searchPatterns, string[] viewPaths, string[] uploadPaths, string[] deletePaths, string selectedUrl, string selectedItemTag)
The current HttpContext.
searchPatternsstring[]Search patterns for files. Allows wildcards.
viewPathsstring[]The paths which will be displayed in the FileManager. You can disregard this value if you have custom mechanism for determining the rights for directory / file displaying.
uploadPathsstring[]The paths which will allow uploading in the FileManager. You can disregard this value if you have custom mechanism for determining the rights for uploading.
deletePathsstring[]The paths which will allow deleting in the dialog. You can disregard this value if you have custom mechanism for determining the rights for deleting.
selectedUrlstringThe selected url in the file browser. The file browser will navigate to the item which has this url.
selectedItemTagstringThe selected tag in the file browser. The file browser will navigate to the item which has this tag.
Properties
protected virtual string ApplicationPath { get; }
Gets a value indicating whether the ContentProvider can create directory items or not. The visibility of the Create New Directory icon is controlled by the value of this property.
public virtual bool CanCreateDirectory { get; }
The HttpContext object, set in the constructor of the class.
protected HttpContext Context { get; }
The paths which will allow deleting in the dialog. This is passed by RadEditor and is one of the values of DeleteImagesPaths, DeleteDocumentsPaths, DeleteMediaPaths, DeleteFlashPaths, DeleteTemplatesPaths properties. You can disregard this value if you have custom mechanism for determining the rights for deleting.
protected string[] DeletePaths { get; }
The character, used to separate parts of the virtual path (e.g. '/' is the path separator in /path1/path2/file)
public virtual char PathSeparator { get; }
Gets the search patterns for the file items to be displayed in the FileBrowser control. This property is set in the constructor of the class. Supports wildcards.
protected string[] SearchPatterns { get; }
Gets or sets the tag of the selected item. The file browser will navigate to the item which has this tag. Used mainly in Database content providers, where the file items have special url for accessing.
[Obsolete("This property is no longer used")]
protected string SelectedItemTag { get; set; }
Gets or sets the url of the selected item. The file browser will navigate to the item which has this url.
protected string SelectedUrl { get; set; }
Gets the paths which will allow uploading in the dialog. This is passed by RadEditor and is one of the values of UploadImagesPaths, UploadDocumentsPaths, UploadMediaPaths, UploadFlashPaths, UploadTemplatesPaths properties. You can disregard this value if you have custom mechanism for determining the rights for uploading.
protected string[] UploadPaths { get; }
Gets the paths which will be displayed in the dialog. This is passed by RadEditor and is one of the values of ImagesPaths, DocumentsPaths, MediaPaths, FlashPaths, TemplatesPaths properties. You can disregard this value if you have custom mechanism for determining the rights for directory / file displaying.
protected string[] ViewPaths { get; }
Methods
Creates a directory item in the given path with the given name.
Moves a directory from a one virtual path to a new one. This method can also be used for renaming items.
Moves a file from a one virtual path to a new one. This method can also be used for renaming items.
Removes the protocol and the server names from the given url.
public static string RemoveProtocolNameAndServerName(string url)
Fully qualified url to a file or directory item.
Returns:The root based absolute path.
Url: http://www.myserver.com/myapp/mydirectory/myfile Result: /myapp/mydirectory/myfile
Url: www.myserver.com/myapp/mydirectory/myfile Result: /myapp/mydirectory/myfile
Resolves a directory with the given path. This method populates the Files collection in the returned DirectoryItem
public abstract DirectoryItem ResolveDirectory(string path)
The virtual path of the directory.
Returns:A DirectoryItem, containing the directory.
Used mainly in the Ajax calls.
Resolves a root directory with the given path in list mode.
[Obsolete("This method is no longer used. Only Tree display mode is supported.")]
public virtual DirectoryItem[] ResolveRootDirectoryAsList(string path)
The virtual path of the directory.
Returns:A DirectoryItem array, containing the root directory and all child directories.
Resolves a root directory with the given path in tree mode. This method populates the Directories collection in the returned DirectoryItem
public abstract DirectoryItem ResolveRootDirectoryAsTree(string path)
The virtual path of the directory.
Returns:A DirectoryItem, containing the root directory.
Stores an image with the given url and image format.
public abstract string StoreBitmap(Bitmap bitmap, string url, ImageFormat format)
The Bitmap object to be stored.
urlstringThe url of the bitmap.
formatImageFormatThe image format of the bitmap.
Returns:string.Empty when the operation was successful; otherwise an error message token.
Used when creating thumbnails in the ImageManager dialog.
Creates a file item from a HttpPostedFile to the given path with the given name.
[Obsolete("Please use the other overload of StoreFile()")]
public virtual string StoreFile(HttpPostedFile file, string path, string name, params string[] arguments)
The uploaded HttpPostedFile to store.
pathstringThe virtual path where the file item should be created.
namestringThe name of the file item.
argumentsstring[]Additional values to be stored such as Description, DisplayName, etc.
Returns:String containing the full virtual path (including the file name) of the file item.
The default FileUploader control does not include the arguments parameter. If you need additional arguments you should create your own FileUploader control.
Creates a file item from a Telerik.Web.UI.UploadedFile in the given path with the given name.
public abstract string StoreFile(UploadedFile file, string path, string name, params string[] arguments)
The UploadedFile instance to store.
pathstringThe virtual path where the file item should be created.
namestringThe name of the file item.
argumentsstring[]Additional values to be stored such as Description, DisplayName, etc.
Returns:String containing the full virtual path (including the file name) of the file item.
The default FileUploader control does not include the arguments parameter. If you need additional arguments you should create your own FileUploader control.