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

Attaching the files to the view model of the over all page instead of uploading within the Upload control?

I want to keep the uploaded files together with the rest of the view model when the page is submitted so that the uploaded files can be saved to the appropriate location after the rest of the page data has been inserted into a DB.

How can I post the uploads with the rest of the page and not as a separate upload?

3 Replies

NP Narayanasamy Panneer Selvam Syncfusion Team July 24, 2019 02:24 PM UTC

Hi John, 
Thanks for contacting Syncfusion support. 
We have validated your query, please find details in below.

 
Query: How can post the uploads with the rest of the page and not as a separate upload? 
 
You can get it done by using form upload option in our EJ2 Uploader. To enable this function, please Set autoUpload API value as false
Don’t set save and removeUrl values in asyncSettings API. 
EJ2 Uploader with the above mentioned configuration, file will be posted in form submit only. 
For your reference we have prepared a sample. Please find it in the below link. 
  
To know more details about form support, please refer below documentation link. 
 
Regards,  
Narayanasamy P.  



JS John Stemper July 26, 2019 06:56 PM UTC

Using the sample solution you referred me to returns a file with no name or content. That is as-is without any changes to the source.


NP Narayanasamy Panneer Selvam Syncfusion Team July 30, 2019 11:34 AM UTC

Hi John, 

Thanks for your update.
 
 
We have validated your problem in the reported scenario. We could able to get the postedFile and filename in controller. Please find the screenshot below, 
 
 
 
However, if want to redirect into view when you click the submit, you can redirect from the controller by using the below code, 
return Redirect("/Home/Index"); 
Please revert to us if we misunderstood your requirement. If yes, kindly share more details about your issue. So that we can quickly provide prompt solution at our end. 
 
 
Regards, 
Narayanasamy P. 


Loader.
Live Chat Icon For mobile
Up arrow icon