We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Uploadbox deny extensions message to client?

I all,

I want to display a message to user when he upload a file with a deny extension ( like file format not allowed). Is it possible to that with Uploadbox?

Looking forward to hearing from you

15 Replies

AP Arun Palaniyandi Syncfusion Team March 1, 2016 09:27 AM UTC

Hi Leks,

Thanks for contacting Syncfusion support,

Query : “I want to display a message to user when he upload a file with a deny extension ( like file format not allowed). Is it possible to that with Uploadbox?”

Yes, we can display an error message to the user for the deny extension by doing sample level modifications. We have already showcased a sample in the online sample browser. Error message will be shown based on  the extension allow or deny when the corresponding file is being uploaded.

Please refer the online sample link given below:
https://asp.syncfusion.com/demos/web/uploadbox/fileinput.aspx

If you have any further questions, feel free to contact us.

Regards,
Arun P.




LE leks March 5, 2016 11:37 AM UTC

Thank you for your answer,

Is there a way to use localisation for the error message?
when i use the attribute Locale="fr-FR" it's not working. Furthermore the uplodbox is not displaying. I've correctly add the necessary scriupts because it's working for datetimepicker.

Best regards...


AP Arun Palaniyandi Syncfusion Team March 7, 2016 12:44 PM UTC

Hi Leks,

Thanks for the update,

Query  #1:” Is there a way to use localisation for the error message?”

Yes, you can localize the error message. To have this we have to set the localized texts  for  the denyerror and allowerror keyword under the corresponding locale culture scripts. We have provided FR-fr culture settings in the attached sample. Please refer it.

Query #2:” when i use the attribute Locale="fr-FR" it's not working. Furthermore the uplodbox is not displaying. I've correctly add the necessary scripts because it's working for datetimepicker.”

Sorry for the inconvenience. We have tried this scenario and unfortunately we are unable to reproduce the issue. We can able set the Locale property and get the localized texts for the error message and also the control get displays. Hence we suggest you to ensure the localized text given in the scripts is correct or not. Please share us screenshots of any console errors in the developer window. So that it would help us to isolate the issue and help you out better.

Please refer the below documentation link:
https://upload9659.azurewebsites.net/

We have also prepared a sample based in this scenario. Please refer the sample below.

https://www.syncfusion.com/downloads/support/directtrac/general/ze/WebApplication-21676826-558915111.zip

Please let us know if you have further queries,                                 

Regards,

Arun P



LE leks March 8, 2016 08:07 AM UTC

Hi Arun,
Thanks for your feedback, please find as attached  the capture of the error message in developer console. I get the error "Cannot read property 'buttonText' of undefined". It only happens when i add the propert locale to my uploadbox. Without that property , i can use the control without error.

Reagrds

Attachment: My_app_c2b89256.rar


AP Arun Palaniyandi Syncfusion Team March 9, 2016 12:05 PM UTC

Hi Leks,

Thanks for the update,

Query:” Thanks for your feedback, please find as attached  the capture of the error message in developer console. I get the error "Cannot read property 'buttonText' of undefined". It only happens when i add the propert locale to my uploadbox. Without that property , i can use the control without error.”

We analyzed the shared screenshots and tried to reproduce the mentioned issue. This issue will arise if you have not exactly given the locale culture in the Locale property. For example,if you gave “fr-FR” in localized cultures in script, “fr-FR” should be mentioned in the Locale property given for the UploadBox and also should give the correct keyword for localized texts in locale script. Hence, we suggest you to refer the correct culture for the Locale property. Please refer the following code snippets:

<code>

<ej:UploadBox ID="Upload1" SaveUrl="saveFiles.ashx" RemoveUrl="removeFiles.ashx" MultipleFilesSelection="true" Locale="fr-FR" ClientSideOnError="onError" runat="server"></ej:UploadBox>

<script type="text/javascript">


ej.Uploadbox.Locale["fr-FR"] = {

            buttonText: {

                upload: "télécharger",

                browse: "Feuilleter",

                cancel: "Annuleer",

                close: "Fermer"

            },

            dialogText: {

                title: "Upload Box",

                name: "prénom",

                size: "Taille",

                status: "statut"

            },

            denyError: "fichiers avec #Extension l'extension ne sont pas autorisés.",

            allowError: "fichiers avec #Extension l'extension ne pas autorisés.",

            cancelToolTip: "Annuleer",

            removeToolTip: "retirer",

            retryToolTip: "recommencez",

            completedToolTip: "terminé",

            failedToolTip: "échoué",

            closeToolTip: "Fermer"
        };

</script>

Please let us know if this information helps you.

Regards,

Arun P



LE leks March 10, 2016 02:34 PM UTC

Hello Arun,
Thanks for the update. I added your script  in globalize.culture.fr-FR.js and now it works. Indeed that script was translating only Calendar Control. Below is the content:

(function( window, undefined ) {

var Globalize;

if ( typeof require !== "undefined" &&
    typeof exports !== "undefined" &&
    typeof module !== "undefined" ) {
    // Assume CommonJS
    Globalize = require( "globalize" );
} else {
    // Global variable
    Globalize = window.Globalize;
}

Globalize.addCultureInfo( "fr-FR", "default", {
    name: "fr-FR",
    englishName: "French (France)",
    nativeName: "français (France)",
    language: "fr",
    numberFormat: {
        ",": " ",
        ".": ",",
        "NaN": "Non Numérique",
        negativeInfinity: "-Infini",
        positiveInfinity: "+Infini",
        percent: {
            ",": " ",
            ".": ","
        },
        currency: {
            pattern: ["-n $","n $"],
            ",": " ",
            ".": ",",
            symbol: "€"
        }
    },
    calendars: {
        standard: {
            firstDay: 1,
            days: {
                names: ["dimanche","lundi","mardi","mercredi","jeudi","vendredi","samedi"],
                namesAbbr: ["dim.","lun.","mar.","mer.","jeu.","ven.","sam."],
                namesShort: ["di","lu","ma","me","je","ve","sa"]
            },
            months: {
                names: ["janvier","février","mars","avril","mai","juin","juillet","août","septembre","octobre","novembre","décembre",""],
                namesAbbr: ["janv.","févr.","mars","avr.","mai","juin","juil.","août","sept.","oct.","nov.","déc.",""]
            },
            AM: null,
            PM: null,
            eras: [{"name":"ap. J.-C.","start":null,"offset":0}],
            patterns: {
                d: "dd/MM/yyyy",
                D: "dddd d MMMM yyyy",
                t: "HH:mm",
                T: "HH:mm:ss",
                f: "dddd d MMMM yyyy HH:mm",
                F: "dddd d MMMM yyyy HH:mm:ss",
                M: "d MMMM",
                Y: "MMMM yyyy"
            }
        }
    }
});

}( this ));

I thought i was for translating all controls with that culture.


AP Arun Palaniyandi Syncfusion Team March 11, 2016 01:08 PM UTC

Hi Leks,

Thanks for the update.

We are glad that your issue has been resolved and we are happy to help you out in future.

Please let us know if you have any concerns,

Regards,
Arun P


LE leks March 13, 2016 10:08 AM UTC

Hi Arun,
I have one more question , and please let me know if i have to open another thread for that?
I use the UploadBox control to upload document and image in Azure Blob Storage. It looks like the bar showing the progress of the upload get almost filled ( fro exeample 99%) and now start to upload document in Azure with that pecentage. When i used it to upload document in my local server , the uploadprogress bar was ok. Is there a way to link the uploadprogressbar with the upload in Azure, so that i shows me the real progress?

Looking forward to hearing from you.

Best regards..


MS Muralishankar Sundaram Syncfusion Team March 14, 2016 01:07 PM UTC

Hi Leks,

Thanks for the update,

We are not able to understand your query clearly and please confirm that, whether your reporting the following query and if it’s not please share your query details briefly with the screen captured video.

“The uploadbox - progress not working properly with azure hosting environment (or)  need to use ejuploadbox progress with the azure fileupload operation.”


Please let us know if you have any other queries.

Regards,
Muralishankar


LE leks March 14, 2016 03:11 PM UTC

Hi Muralishankar,

I need to use ejuploadbox progress with the azure fileupload operation.
Here is the screen capture video:
https://youtu.be/bzxReBihc1c
As you can see the progress is filled quickly and only after that, the upload operation in azure starts.

Best regards....




AP Arun Palaniyandi Syncfusion Team March 15, 2016 12:31 PM UTC

Hi Leks,

Thanks for your update.

We have tried to open the shared link and we got the below error. Hence we request you to share us the exact video link to download or set the video setting as public for this video.








Please let us know if you have any other queries.

Regards,

Arun P


LE leks March 15, 2016 01:57 PM UTC

Hi,
The video is now plublic : https://youtu.be/bzxReBihc1c  . Futhermore you can download it here:
https://onedrive.live.com/redir?resid=CBDE75E8E85AE3A7!2447&authkey=!ALJY4917TyexClU&ithint=video%2cwmv

Best regards...


AP Arun Palaniyandi Syncfusion Team March 17, 2016 01:09 PM UTC

Hi Leks,

Thanks for the update.

Query:”I use the UploadBox control to upload document and image in Azure Blob Storage. It looks like the bar showing the progress of the upload get almost filled ( for example 99%) and now start to upload document in Azure with that pecentage. When i used it to upload document in my local server , the uploadprogress bar was ok. Is there a way to link the uploadprogressbar with the upload in Azure, so that i shows me the real progress?”


We have created a File Upload sample with using the Microsoft azure and tried to reproduce the mentioned scenario and unfortunately we are unable to reproduce the reported issue. The file upload Progress bar works fine as like in the local server and we can able to see the file upload’s progress. We have also shared our Azure sample link below. Please verify this link.

Link : https://upload9659.azurewebsites.net/

We also suspect that this may occur due to the network issues. So we also request you to share your system and server configuration details. And also kindly share your azure hosted sample link, we will check and ensure the file upload in our end .

Kindly share the details , this will help us to provide better solution.


Regards,

Arun P



LE leks March 24, 2016 08:19 PM UTC

Hi Arun,
thanks for the update. Indeed i've tried in Azure hosted environment and it works fine. So, it happens only when you want to upload document in azure blob from local dev environment.

Anyway thank you for assistance, it helps me a lot.

Best regards....


KV Karthikeyan Viswanathan Syncfusion Team March 25, 2016 11:34 AM UTC

Hi Lejks,
Thank you for your update.

Please let us know if you need any other assistance. We will be happy to assist you.

Regards,
Karthikeyan V.





Loader.
Up arrow icon