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

How Do I: Direct download files and Enable / disable commands

3 Answers 136 Views
FileExplorer
This is a migrated thread and some comments may be shown as answers.
Amol
Top achievements
Rank 2
Amol asked on 27 Jul 2009, 10:48 AM
Hello,

I have few queries on FileExplorer,

How Do I,
  1. Direct Download files without preview window ? I want to download files when users clicks on "open" command
  2. Enable / disable option for delete folders only in  GridContextMenu ? 

As depending on user roles , I want to set permissions for FileExplorer depending on users access.
I have used hide commands using remove items property, but not able to Enable / disable option for delete folders as GridContextMenu displays both files and folders.

So,  How do I remove "Delete" command for folders only in GridContextMenu which shows files and folders.

Thanks,
Amol





3 Answers, 1 is accepted

Sort by
0
Fiko
Telerik team
answered on 27 Jul 2009, 05:35 PM
Hello Amol,

I believe that this online example and this KB article will be of help for you.

Regards,
Fiko
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Amol
Top achievements
Rank 2
answered on 28 Jul 2009, 04:16 AM
Hello Fiko ,
Thanks for your replay.

I have read both online example and KB article ,

1. Downlaod: Demo to download image files has used javascript, Is there any server side property to enable / disable direct download?
because I dont want to compare each file extensional in JS e.g gif, bmp, jpg, png, txt...etc..

2.  Delete:  I have used KB  and it works well for RadToolBar, RadTreeView. 
As I already mention, I want to disable delete option only for folders not files in GridContextMenu.

Could you please tell me how to achieve this?

Thanks,
Amol



0
Accepted
Fiko
Telerik team
answered on 31 Jul 2009, 06:50 AM
Hello Amol,

In reference to your questions :
  • The FileExplorer control does not have property that forces the browser to open a file for direct download. This is due to the fact that each browser has custom settings (i.e. the user can configure the browser how to treat files for download) and it is hard to implement a universal solution for that. In your case you need to use some JavaScript in order to assign a new URL to the document.location. Then you need to use a GenericHandler that will handle the request and force the browser to open a specific file for direct download. This part of solution, however, is a common ASP.NET programming task and you need to implement it yourself. 
  • Regarding the second question, I have prepared a sample project that shows how to achieve the desired behavior. Please find it attached to the thread and let me know whether it fits your requirements.

I hope this helps.

Kind regards,
Fiko
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Tags
FileExplorer
Asked by
Amol
Top achievements
Rank 2
Answers by
Fiko
Telerik team
Amol
Top achievements
Rank 2
Share this question
or