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

[Solved] FileBrowserContentProvider Cannot write to the target folder

3 Answers 116 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Niclas Ahlqvist
Top achievements
Rank 1
Niclas Ahlqvist asked on 24 Feb 2010, 06:00 PM
Hi!

I have some problems with my custom FileBrowserContentProvider.

I the Image editor I get an error message "Cannot write to the target folder".

I guess it has something to do with the path set in FileItem constructor and/or DirectoryItem constructor.

Ive set uploadpaths to "/" which I read in another forum thread.

Can you please explain how the paths set are used.

3 Answers, 1 is accepted

Sort by
0
Fiko
Telerik team
answered on 01 Mar 2010, 02:40 PM
Hello Nicolas,

There may be a couple of reasons for this message:
  • The CheckWritePermissions method of the content provider does not return the correct value, that applies to the logic of the implemented content provider. This method is called in order to determine whether a folder has write permission set.
  • The application, in which the RadFileExplorer is used, does not have permissions to write to the folder. You can check this by using this code:
    protected void Page_Load(object sender, EventArgs e)
    {
        System.IO.Directory.CreateDirectory(@"C:\PathToDirectory");
        System.IO.File.Create(@"C:\PathToDirectory\PathToFile");
        System.IO.File.Delete(@"C:\PathToDirectory\PathToFile");
        System.IO.Directory.Delete(@"C:\PathToDirectory", true);
    }
    If this is the case, then an exception will be thrown in the Page_Load event. You can check the message of the exception in order to get the details report about the error.
I hope this helps.

Best wishes,
Fiko
the Telerik team

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 Public Issue Tracking system and vote to affect the priority of the items.
0
Niclas Ahlqvist
Top achievements
Rank 1
answered on 01 Mar 2010, 02:49 PM
Hi!

Thanks for the reply.

CheckWritePermissions always return true.

The asp.net devolopment server has permissions to write in the target dir.

I think this is a logical problem.

Since the files are stored in the database I dont have a physical filepath for them.

I wonder what path and location I should set in the FileItem and DirectoryItem contructor when neither exist on disc only in the database.
0
Fiko
Telerik team
answered on 04 Mar 2010, 12:00 PM
Hello Niclas,

Could you please check this online demo? It shows a custom FileBrowserContentProvider which connects the RadFileEditor control with a SQL database. A fully working project can be downloaded from this code library as well.

I hope this helps.

Regards,
Fiko
the Telerik team

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 Public Issue Tracking system and vote to affect the priority of the items.
Tags
Editor
Asked by
Niclas Ahlqvist
Top achievements
Rank 1
Answers by
Fiko
Telerik team
Niclas Ahlqvist
Top achievements
Rank 1
Share this question
or