Server-side validation

8 posts, 1 answers
  1. Helen
    Helen avatar
    10 posts
    Member since:
    Jun 2009

    Posted 26 Jun 2009 Link to this post

    I'm using FileExplorer control for file upload. I should perform some specific file checks on server-side and alarm user. How I can do it?

  2. Answer
    Fiko
    Admin
    Fiko avatar
    1406 posts

    Posted 26 Jun 2009 Link to this post

    Hi Helen,

    You could use the OnCommand event of the RadFileExplorer control and perform the specific checks. For your convenience I have attached a demo to this thread.

    I hope this helps.

    Best wishes,
    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. Helen
    Helen avatar
    10 posts
    Member since:
    Jun 2009

    Posted 28 Jun 2009 Link to this post

    Thank you very much for you help!
  4. Helen
    Helen avatar
    10 posts
    Member since:
    Jun 2009

    Posted 29 Jun 2009 Link to this post

    :(  It does not work. The method OnItemCommand in an example is not fired on upload file.  It's work with create, delete, rename directory only. Why?
  5. Helen
    Helen avatar
    10 posts
    Member since:
    Jun 2009

    Posted 29 Jun 2009 Link to this post

    I tried to use method RadFileExplorer. Upload. ValidatingFile. but  method StoreFile in my ContentProvider is fired earlier then ValidatingFile :(
  6. Fiko
    Admin
    Fiko avatar
    1406 posts

    Posted 30 Jun 2009 Link to this post

    Hello Helen,

    By design the OnItemCommand event is fired in the following commands :
    • UploadFile - fired before each uploaded file is saved
    • MoveDirectory - fired before a directory is moved/renamed
    • CreateDirectory - fired before the file explorer creates a new folder
    • DeleteDirectory - fired before the file explorer deletes a folder
    • DeleteFile - fired before a file is deleted
    • MoveFile - fired before a file is moved/rename

    In the project attached to my previous response i used the OnItemCommand  event in order to perform validation. I also implemented simple logic(check the length of the path of the uploaded file) in order to cancel the uploading, and it works as expected. I also tested it with a custom provider but the OnItemCommand is fired and worked as expected.
    At this point I cannot tell what is causing the problem in your case. That is why it will be best if you open a new support ticket and send me a full sample project which reproduces the problem that you experience. Once I have a better view over your setup, I will do my best to provide a solution right away.

    All the best,
    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.
  7. Helen
    Helen avatar
    10 posts
    Member since:
    Jun 2009

    Posted 01 Jul 2009 Link to this post

    My problem has been solved, after updating of the library version from 1.311 to 1.527. Thank !
  8. Atlas
    Atlas avatar
    97 posts
    Member since:
    Jun 2009

    Posted 03 Mar 2010 Link to this post

    I posted this elsewhere, but just to let others know, the event: RadFileExplorer1_ItemCommand fires once for each file you upload, so if you upload three files, it fires three times. Each time it fires, it is going to iterate through all the files that were uploaded. that would be 9 checks for:

    file.FileName.Length

    > 10

     

Back to Top