RADUpload InvalidFile Reason Code?

Thread is closed for posting
6 posts, 0 answers
  1. Bo
    Bo avatar
    3 posts
    Member since:
    Aug 2011

    Posted 10 Aug 2011 Link to this post

    I saw a similar thread under RADControls, but didn't see any answer so I thought I'd post here.  I have a RADUpload control placed on a page with AllowedFileExtensions set to allow ".doc,.docx,.xls,.xlsx,.zip,.txt,.csv,.pdf" and a MaxFileSize set to 15MB.  I'm using client-side validation and have tested to ensure that invalid file types are being caught prior to form submission.  My problem is that in uploading two, both valid, .xlsx files, one completes successfully and the other ends up in the InvalidFiles collection.  I'm at a loss as to why one would work and the other not.  Is there any way to access how a file fails to pass server-side validation?
  2. Kevin
    Kevin avatar
    360 posts
    Member since:
    Jul 2012

    Posted 11 Aug 2011 Link to this post

    Hello Bo,

    Are both files below 15MB in size? It should only add them to the InvalidFiles collection if they don't match one of the valid file extensions or is greater than the max file size.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Bo
    Bo avatar
    3 posts
    Member since:
    Aug 2011

    Posted 11 Aug 2011 Link to this post

    Yes, both files are well under the 15MB restriction.  The confounding part is that it works perfectly fine on a dev server.  Deploy the same .aspx and .cs file to a prod server then it stops allowing one file while continuing to allow the other.
  5. Peter Filipov
    Admin
    Peter Filipov avatar
    1028 posts

    Posted 16 Aug 2011 Link to this post

    Hello Bo,

    I wasn't able to reproduce your issue. Please send me a working sample project that reproduces your issue. Please also record a video of your cases.

    Kind regards, Peter Filipov
    the Telerik team

    Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

  6. Bo
    Bo avatar
    3 posts
    Member since:
    Aug 2011

    Posted 16 Aug 2011 Link to this post

    Peter,

    I removed and re-added the control and the it appears to work now.  However, I'd still be interested in any sort of reason code when a file is deemed invalid.  Also, is there any way to specify excluded file types only instead of allowable?  For example, accept any file except a PDF file?
  7. Peter Filipov
    Admin
    Peter Filipov avatar
    1028 posts

    Posted 18 Aug 2011 Link to this post

    Hello Bo,

    I am still not able to reproduce your issue. It is really interesting that after you added the RadUpload control on the page everything works fine. A file goes into invalid collection if it's size is bigger than the MaxFileSize property or it has different file type than allowed.

    It is not possible to specify excluded file types. To achieve that you need to implement your custom server side logic.

    Kind regards,
    Peter Filipov
    the Telerik team

    Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

Back to Top
UI for ASP.NET Ajax is Ready for VS 2017