Modify files in FileExplorer

4 posts, 0 answers
  1. saritha78
    saritha78 avatar
    23 posts
    Member since:
    Dec 2009

    Posted 22 Feb 2011 Link to this post

    I am using CustomProvider to show files from a shared network drive in a web application hosted on the intranet. How can I allow users to modify files (mostly text files).
    Thanks,
  2. Dobromir
    Admin
    Dobromir avatar
    1633 posts

    Posted 28 Feb 2011 Link to this post

    Hi Saritha,

    RadFileExplorer does not offer the required functionality out-of-the-box and such functionality cannot be provided for the general scenario, because when file is opened in the browser it is not the exact file on the server but a copy that is actually downloaded. Could you please provide more describe the exact scenario in more detail so we can try to provide a solution to the case?

    On a side note, if you need to modify HTML files or plain text files(txt) you can use RadEditor to load the files and modify their content using the following approach:
    1. Assign a handler to the RadFileExplorer's OnClientFileOpen event to get reference to the file and pass its path to to the server. Please take a look at this KB article.
    2. Load the content of the passed file in the RadEditor using its Content property.
    3. Store the modified content back to the file.

    Regards,
    Dobromir
    the Telerik team
    Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. saritha78
    saritha78 avatar
    23 posts
    Member since:
    Dec 2009

    Posted 01 Mar 2011 Link to this post

    Hi Dobromir,
    Thanks for your reply. Here's the exact scenario:

    I am using this for an intranet site, used only by the employees in house.
    They can currently go to a shared folder on a network drive which has multiple sub folders for each customer by the customer number, which in turn have different files and folders. They can edit, move, delete, upload files to these folders. And currently everybody in our company does that by going to the network drive through windows explorer. I am trying to bring it into our custom web application so that we can restrict access to the folders on the network drive from windows explorer.

    I am using CustomProvider for the RadFileExplorer to load the folders. On page load, I build the xml string for the CustomFileBrowserProvider based on the customer number and store it in session variable, which I get on the Initialize() of FileSystemHandler.ashx and map the physical and virtual paths. It seems to be working fine for everythign except edits. They can open file, move files, upload, create new folder, rename files etc with no problem. But I also need to be able to give them the ability to edit files which can be of different file formats. How do I do that? Without the ability to edit files, this whole project becomes useless.

    Thanks,
  5. Dobromir
    Admin
    Dobromir avatar
    1633 posts

    Posted 07 Mar 2011 Link to this post

    Hi Saritha,

    Thank you for the provided detail information.

    As I mentioned in my previous answer, when a file is opened by the browser, the displayed file is not the actual file that resides on the server but a downloaded copy. This is not a restriction of RadFileExplorer but is the standard concept - users do not have direct access to the files, they are served by the web server.

    In order to achieve the required functionality, I would recommend to instruct the users to download the files, modify them and then upload the files back. In the following live demo you can find an example of how to force file download:
    Filter files and download

    Regards,
    Dobromir
    the Telerik team
    Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!
Back to Top