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

4 posts, 1 answers
  1. Amol
    Amol avatar
    57 posts
    Member since:
    Apr 2008

    Posted 27 Jul 2009 Link to this post

    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





  2. Fiko
    Admin
    Fiko avatar
    1406 posts

    Posted 27 Jul 2009 Link to this post

    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.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Amol
    Amol avatar
    57 posts
    Member since:
    Apr 2008

    Posted 27 Jul 2009 Link to this post

    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



  5. Answer
    Fiko
    Admin
    Fiko avatar
    1406 posts

    Posted 31 Jul 2009 Link to this post

    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.
Back to Top