File Path Copy/Paste

3 posts, 0 answers
  1. Craig Tarr
    Craig Tarr avatar
    13 posts
    Member since:
    Oct 2009

    Posted 22 Oct 2010 Link to this post

    I'm looking for a way to take the selected file in teh FileExplorer and grab it's file path and make it availble in the clipboard as a copy/paste.

    If the file has been uploaded to a folder location like /Documents/Secured/Downloads/ and the file name is Fall2010.pdf. I want to be able to copy that full path including the filename and paste the text (not the actual file) into a text box in another window of my CMS tool.

    I have a working solution using the zeroClipboard solution, Flash and jQuery. It works but several of my users are running into a problem where the computer clipboard is not updating and the copy of a new file path is failing. I've reinstalled Flash on those PC's and it's still very hit or miss.

    Are there any methods already available in the FileExplorer that I may be overlooking? Has anyone implemented a different solution that works?

    Looking closer at the tool, I see that the current folder path is displayed below the menu bar. But when I select a file the path doesn't update. That would be a good workaround if the path updated. I'll look at the docs and forum posts to see if I can do this.
  2. Fiko
    Fiko avatar
    1406 posts

    Posted 27 Oct 2010 Link to this post

    Hello Craig,

    In general you can attach a handler to the RadFileExplorer's OnClientItemSelected event of the control and get the selected item:
    <script type="text/javascript">
        function OnClientItemSelected(oExplorer, args)
            var item = args.get_item();
            if (!item.isDirectory())
            {// the item is a file
                var filePath = item.get_path();
                var fileUrl = item.get_url();
                // Use the path..
                // ...

    Please note that the browsers does not allow access to the clipboard from JavaScript (except IE) and you should implement the rest of the logic using some plugin.

    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
  3. Craig Tarr
    Craig Tarr avatar
    13 posts
    Member since:
    Oct 2009

    Posted 28 Oct 2010 Link to this post

    Works for me. We're limiting users to IE 7 or 8 so the JavaScript window.clipboardData will do fine. And this is an internal app so we don't have to worry as much about allowing the browser access to the clipboard.

Back to Top