Accsasing a file before upload

4 posts, 0 answers
  1. Oren
    Oren avatar
    21 posts
    Member since:
    Mar 2012

    Posted 26 Aug 2013 Link to this post

    Hello, i want to use the radUpload control but before i starting building i need to do if the control supports the feature I'm looking for:

    i want to know if i can access the file that is about to upload before the actual upload part,
    For example i want to check an attribiute of the meta-data of a movie file for some kind of value and only if it match i want to allow it to be uploaded, is it possible to do with this control?

    Thanks,
    Oren.
  2. Kiril Vandov
    Admin
    Kiril Vandov avatar
    324 posts

    Posted 29 Aug 2013 Link to this post

    Hello Oren,

    You could use the build in validation of the RadUpload where you have access to the current RadUploadItem. You can find more information about this approach in this article.
    However you can not stop file from uploading based on meta-data located in the Request Header. Because once the upload button is pressed and the session is started all files move through the validation which assures the correctness of the files. Also once the session is started you can only pause or cancel the session, you can not modify the Items collection.

    I hope this information helps.

    Kind regards,
    Kiril Vandov
    Telerik
    TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for SILVERLIGHT.
    Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
    Sign up for Free application insights >>
  3. DevCraft banner
  4. Oren
    Oren avatar
    21 posts
    Member since:
    Mar 2012

    Posted 02 Sep 2013 Link to this post

    Hello Kiril,
    thank you for your replay,
    However, i am still not clear about the answer so ill ask it another way.

    lets say i want my user to upload a bunch of text files (*.txt),
    However i only want to allow them to upload files that end with the sentence "thank you", (not the file name, the actual file).
    Is there a way to do so with this control?
    or my only option is to let him upload the file, and after the file is in my server, check for the sentence?

    Kind regards,
    Oren.
  5. Kiril Vandov
    Admin
    Kiril Vandov avatar
    324 posts

    Posted 04 Sep 2013 Link to this post

    Hello Oren,

    Unfortunately the RadUpload does not support such kind of file validation. You need to upload the file first and then check its content on server side.

    Please let us know if you have further questions.

    Kind regards,
    Kiril Vandov
    Telerik
    TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for SILVERLIGHT.
    Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
    Sign up for Free application insights >>
Back to Top