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

RADUpload InvalidFile Reason Code?

5 Answers 81 Views
Upload (Obsolete)
This is a migrated thread and some comments may be shown as answers.
Bo
Top achievements
Rank 1
Bo asked on 10 Aug 2011, 10:10 PM
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?

5 Answers, 1 is accepted

Sort by
0
Kevin
Top achievements
Rank 2
answered on 11 Aug 2011, 12:57 PM
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.
0
Bo
Top achievements
Rank 1
answered on 11 Aug 2011, 08:55 PM
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.
0
Peter Filipov
Telerik team
answered on 16 Aug 2011, 01:28 PM
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.

0
Bo
Top achievements
Rank 1
answered on 16 Aug 2011, 10:47 PM
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?
0
Peter Filipov
Telerik team
answered on 18 Aug 2011, 12:31 PM
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.

Tags
Upload (Obsolete)
Asked by
Bo
Top achievements
Rank 1
Answers by
Kevin
Top achievements
Rank 2
Bo
Top achievements
Rank 1
Peter Filipov
Telerik team
Share this question
or