Current filter:
                                You should refresh the page.
                                0
                                  • I have defined an Uploadcontrol like this:

                                    	
                                    [ASPx]
                                    <dx:ASPxUploadControl ID="uplFile1" runat="server" ClientInstanceName="uploader" ShowProgressPanel="True" NullText="Hier Klicken, um Datei auszuwählen..." Size="40" ShowClearFileSelectionButton="False" ShowUploadButton="True" FileUploadMode="OnPageLoad" > <ValidationSettings MaxFileSize="6123456" AllowedFileExtensions=".pdf" MaxFileSizeErrorText="file is too large" GeneralErrorText="some custom error message" > </ValidationSettings> <BrowseButton Text="Auswählen..."></BrowseButton> </dx:ASPxUploadControl>

                                    If I try to upload a file that is larger than my maxRequestLength setting, I still get the standard german error message: Der Server hat einen internen nicht näher spezifizierter Fehler, der die Erfüllung der Anforderung verhindert. If the file's size is between MaxFileSize and maxRequestLength the custom error message specified in MaxFileSizeErrorText is displayed - just the GeneralErrorText doesn't work.


                                    What could I have done wrong?


                                    Thanks for your support,

                                    Thomas

                                You must  log in  or  register  to leave comments

                                1 Solution

                                0
                                • Thomas Staudte 09.12.2012

                                  Sorry, I think you misunderstood. I'm not worried about the error message as such - I'm worried that I can't specify a custom text for it by changing the GeneralErrorText setting.

                                • Hi Thomas,

                                  I am afraid there are no any way to customize the error message in the Upload control when a file size is larger than the maxRequestLength property value. The best way to accomplish your task is to set the maximal file size via the ASPxUploadControl.ValidationSettings.MaxFileSize property.

                                  We have discussed this issue in the ASPxUploadControl - How to customize the error message when the MaxRequestLength value is exceeded ticket.

                                • Thomas Staudte 09.13.2012

                                  Well, in order to use the MaxFileSize, I must set maxRequestLength to the largest thinkable value. In my case, I want to allow users to upload up to 4 MB - knowing the dummies out there, I would have to set maxRequestLength to 20 or 30 MB. That could eat up my servers RAM and would make it (even more) vulnerable to DOS attacks.

                                  I have now patched the binary resource.dll with a hex editor and modifed the error message in a suitable way (so that it mentions the 4 MB system limit). Too bad there is no other way to change that easily...

                                You must  log in  or  register  to leave comments
                                You must  log in  or  register  to leave an answer

                                Is your intention to post an answer to your own question?

                                • If so, then proceed.
                                • If you simply wanted to post additional information, ask for further clarification, or to just say "Thanks!", please click Leave a Comment.
                                • If you wish to edit your original question, please use the Edit button in the Toolbox at the top right corner of that entry.