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.
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Send notifications to client while uploading file

Thread ID:

Created:

Updated:

Platform:

Replies:

120536 Sep 24,2015 06:42 AM Oct 6,2015 12:24 AM ASP.NET Web Forms 7
loading
Tags: Uploadbox
Manolo
Asked On September 24, 2015 06:42 AM

Hi,

I want upload a file and process this file into server-side, but I want notify at client the different status while server process the file.

But all my notifications appear after the process ends, not during the process.

My code-behind:

        protected void ubImportacionOperaciones_Complete(object sender, Syncfusion.JavaScript.Web.UploadBoxCompleteEventArgs e)
        {
            ProcesarFichero(e.Name);
        }

        private void ProcesarFichero(string fichero)
        {
            try
            {
                AñadirLog(String.Format("Fichero: {0} subido correctamente", fichero));
                string file = HttpContext.Current.Server.MapPath("uploadfiles") + "\\" + fichero;
                string rutaDestino = HttpContext.Current.Server.MapPath("uploadfiles") + "\\" + Path.GetFileNameWithoutExtension(fichero) + "\\Decompress";

                if (Directory.Exists(rutaDestino))
                    Directory.Delete(rutaDestino, true);

                AñadirLog(String.Format("Fichero: {0} descomprimido", fichero));
                ZipFile.ExtractToDirectory(file, rutaDestino);

                foreach (string fileCSV in Directory.GetFiles(rutaDestino, "*.csv"))
                {
                    ImportarFichero(fileCSV);
                }
            }
            catch(Exception ex)
            {
                AñadirLog(ex.Message);
            }

        }

        private void AñadirLog(string mensaje)
        {
            var item = new ListBoxItems();
            item.Text = String.Format("{0} -> {1}", DateTime.Today.ToString(), mensaje);
            lbLog.Items.Add(item);
        }

Thanks

Kasithangam C [Syncfusion]
Replied On September 25, 2015 04:39 AM

Hi Manolo,

While upload a file in uploadbox, we can notify the status of the uploading files in client side by using our client side events. We have a documentation link for Uploadbox client side events and please go through the following API link:

http://help.syncfusion.com/js/api/ejuploadbox#events

We have prepared the sample based on this and please refer to the following location:

Sample: Sample

Could you please check the above sample whether its meets your requirement? Please let us know if you have further query.  

Regards,

Kasithangam


Manolo
Replied On September 25, 2015 05:47 AM

Hi,

I've modofy your example with my problem.

I want to do a post-process in event "OnComplete" and notify the different status at client.

I've use a ListBox but I can use other control if it is necessary.

In my example, I notify all actions when the event "OnComplete" finish, not during "OnComplete"

Attachment: SampleButton_a3f8322f.zip

Kasithangam C [Syncfusion]
Replied On September 28, 2015 08:41 AM

Hi Manolo,

In our uploadbox, “OnComplete” server side event triggers when the file upload is completed.So we can’t able to notify the processing uploaded file information in client side through the OnComplete event.We can display the processing uploaded file information in client side by using the “inprogress” client side event.Can you please confirm on whether you are expecting to display the uploading file each step by step process (Begin, uploading data in %, complete) in client side.The provided information would be helpful for us to serve you.

Please let us know if you have any query.

Regards,

Kasithangam


Manolo
Replied On September 30, 2015 02:57 PM

Hi again,

I solve this problem showing a waiting pop up.

But I've another problem...

After upload a file, I want that user can download a log file with results of to process the upload file. I can do it, but after download the file I can't upload other file.

In the example, I upload a file, after a button is showd to download a log file. After download this log, I can't upload other file.

Thanks

Attachment: SampleButton_6966fb74.zip

Kasithangam C [Syncfusion]
Replied On October 1, 2015 11:54 AM

Hi Manolo,

We are able to reproduce the issue “After download log file,while upload another file OnComplete server side event doesn’t triggers ”.Currently we are analyzing on this issue.So we need two business days (5th October,2015) to validate more on this and update the details.

Please let us know if you have further query.

Regards,

Kasithangam


Manolo
Replied On October 2, 2015 03:30 AM

Ok, no problem

Thank you very much

Kasithangam C [Syncfusion]
Replied On October 6, 2015 12:24 AM

Hi Manolo,

Currently we don’t have the support to achieve this behavior, and we have logged defect report for your requirement”After download log file, can’t able to upload another file and OnComplete server side event doesn’t triggers”. A support incident to track the status of this issue has been created under your account. Please log on to our support website to check for further updates.

https://www.syncfusion.com/account/login?ReturnUrl=%2fsupport%2fdirecttrac%2fincidents 

Please let us know if you have further concern.


Regards,

Kasithangam


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;