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

Is there is any easy way to allow users to copy the uploaded file complete path in RadFileExplorer?

2 Answers 18 Views
FileExplorer
This is a migrated thread and some comments may be shown as answers.
ABC
Top achievements
Rank 1
ABC asked on 24 Jul 2013, 10:43 AM
I am using RadFileExplorer which looks good. But users also want to copy the path of the uploaded file. Is there any easy way? For example, right click and Copy Path.

2 Answers, 1 is accepted

Sort by
0
Vessy
Telerik team
answered on 26 Jul 2013, 03:19 PM
Hello,

I am not sure that I understand what exactly do you mean with "users also want to copy the path of the uploaded file":
  • if you want the user to be able to copy the server path to the currently uploaded file - this functionality is not available out-of-the box but you can achieve it by adding a custom command in the Grid context menu, where to implement the desired functionality. More information is available here: Adding a custom button to the toolbar and an item to the tree context menu
    For example, you could do it in a similar way:
    ASPX
    <
    telerik:RadFileExplorer ID="RadFileExplorer1" runat="server" OnClientLoad="OnClientLoad">
        <Configuration ViewPaths="~/Images" UploadPaths="~/" DeletePaths="~/Images" />
    </telerik:RadFileExplorer>
    <script type="text/javascript">
        function OnClientLoad(explorer, args) {
            explorer.get_gridContextMenu().add_itemClicked(gridContextMenuClicked);
        }
        function gridContextMenuClicked(sender, args) {
            var buttonValue = args.get_item().get_value();
            if (buttonValue == "copyPath") {
                var path = $find("RadFileExplorer1").get_selectedItem().get_path();
                window.alert(path);
            }
        }
    </script>
    C#
    protected
    void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            RadMenuItem customMenuOption = new RadMenuItem("Copy Path");
            customMenuOption.Value = "copyPath";
            RadFileExplorer1.GridContextMenu.Items.Add(customMenuOption);
        }
    }
  • if you want to access the original path to the uploaded file (from the user's PC) - I am afraid that cannot be achieved. More detailed information on the subject is available here.

I hope you will find this information helpful. Feel free to contact us if we could be of any further assistance.

Regards,
Veselina Raykova
Telerik
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
0
ABC
Top achievements
Rank 1
answered on 18 Sep 2013, 11:46 AM
I want a Context Menu option to Copy Path
Tags
FileExplorer
Asked by
ABC
Top achievements
Rank 1
Answers by
Vessy
Telerik team
ABC
Top achievements
Rank 1
Share this question
or