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
close icon

Synchronous upload: file doesn't save when close popup

Hello everybody!

1) I am using Synchronous upload, but when I close upload popup window and click submit, in controllers ActionResult i have file argument as a null.
But if I click to submit without closing upload popup window everything is ok.

2) After closing popup window I want to show user his queque of upload files with an opportunity of delete (you have realized this in MVC classic demos)

3 Replies

KV Karthikeyan Viswanathan Syncfusion Team January 2, 2017 12:34 PM UTC

Hi John, 
  
Thanks for contacting Syncfusion Support. 
 
Please find the details: 
 
Query 
Response 
I am using Synchronous upload, but when I close upload popup window and click submit, in controllers ActionResult i have file argument as a null. 
But if I click to submit without closing upload popup window everything is ok. 
 
While close the upload popup window , We have remove and refresh the selected files. So, Argument throws a null value.  
 
You want to hide the upload popup window means, you can set ShowFileDetails(false). 
 
Find the code snippet: 
<code> 
 
                    @{Html.EJ().Uploadbox("UploadDefault").SaveUrl("SaveDefault").RemoveUrl("RemoveDefault").AsyncUpload(false).ShowFileDetails(false).Render();} 
 
</code> 
 
After closing popup window I want to show user his queque of upload files with an opportunity of delete (you have realized this in MVC classic demos) 
You can show the selected files using FileSelect event. You can get the selected files in an argument. Please find the below code snippet: 
<code> 
 
@{Html.EJ().Uploadbox("UploadDefault").SaveUrl("SaveDefault").RemoveUrl("RemoveDefault").AsyncUpload(false).ShowFileDetails(false).ClientSideEvents(obj => obj.FileSelect("begin")).Render();} 
                
 
function begin(args) { 
        for (var i = 0; i < args.files.length;i++) 
            $("<li class='e-upload-file'></li>").append("<div class='e-file-list'><div class='e-file-progress e-file-view'><div class='e-file-name e-file-view'><span class='e-file-name-txt'>" + args.files[i].name + "</span></div></div><div class='e-file-size e-file-view'><span class='e-file-name-txt'>" + args.files[i].size + "</span></div><div class='e-file-percentage e-file-view'><div class='e-file-progress-bar'><div class='e-file-progress-status'></div></div></div><div class='e-action-perform'><div class='e-icon e-file-cancel' data-content='Cancel'></div></div></div>").appendTo("ul.upload.e-ul"); 
    } 
 
</code> 
 
In general, Synchronous upload files can’t remove at particular. We have no option for remove the particular item in Synchronous upload files. You can only remove the whole files.  
 
 
Regards, 
Karthikeyan V. 



JO John January 3, 2017 07:16 AM UTC

Thank YOU!


KV Karthikeyan Viswanathan Syncfusion Team January 4, 2017 04:39 AM UTC

Hi John,  
 
Thanks for the update.  
 
We are glad the suggestion helped you to achieve your requirement.  
Please let us know if you need further assistance.  
 
Regards,   
Karthikeyan V. 


Loader.
Live Chat Icon For mobile
Up arrow icon