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

I cannot drag anything to the browser

I have two issues

1. I would like to know how I send more data besides images 

2. I tried to drag documents to the Uploader component but It doesn´t work ( it loads the image but as a entire new page )

Attachment: Upload_32e74826.zip

3 Replies

SP Sureshkumar P Syncfusion Team November 25, 2019 01:17 PM UTC

Hi Ricardo, 
 
Greetings from Syncfusion support. 
 
Query 1:  I would like to know how I send more data besides images 
 
Answer:  
            Since the provided details are insufficient to proceed further, we request you to share us the following details  
 
1.     Whether you want to upload the image details as extra parameter or not? 
2.     If possible give an image or video representation of your requirement. 
 
 These details will help us to provide solution earlier. 
 
Query 2: I tried to drag documents to the Uploader component but It doesn´t work ( it loads the image but as a entire new page ) 
 
Answer:  
            We have validated your requirement with shared image and code. We suspect that your drop area not set properly in your application. We created a sample and video representation based on your requirement.  
 
Kindly refer the below code block. 
 
<div class="container"> 
    <div class="control_wrapper"> 
        <div id='dropArea' style='height: auto; overflow: auto'> 
            <span id='drop'> <a rel='nofollow' href='' id='browse'><u>Click para seleccionar el archivo</u></a> </span> 
            @Html.EJS().Uploader("UploadFiles").DropArea("#dropArea").AllowedExtensions(".jpg,.png,.jpeg").Selected("onSelect").Success("onUploadSuccess").Progress("onFileUpload").Removing("onFileRemove").Failure("onUploadFailed").AsyncSettings(new Syncfusion.EJ2.Inputs.UploaderAsyncSettings { SaveUrl = "/Mantenimiento/Preventivo/SaveP", RemoveUrl = @Url.Content("Remove") }).Render() 
        </div> 
    </div> 
</div> 
 
 
 
Kindly refer the sample with video representation:  https://www.syncfusion.com/downloads/support/forum/149345/ze/video-1919560470  
 
Regards, 
Sureshkumar P 



RI Ricardo December 6, 2019 12:26 AM UTC

I mean, how I send parameters from an input like a textbox to the "saver" method. I could send data from the parameters directly but how should I do if I want to use javascript

Attachment: upload_params_f05192e8.zip


SP Sureshkumar P Syncfusion Team December 6, 2019 07:04 AM UTC

Hi Ricardo, 
 
Greetings from Syncfusion support. 
 
Yes, we can able to send the additional parameter to server method from script section by our inbuild client side Uploading event.  
 
Kindly refer the below code block. 
 
<div class="control_wrapper"> 
    @Html.EJS().TextBox("text").Value("selectValue").Render() 
 
    @Html.EJS().Uploader("fileupload").Uploading("onFileUpload").AsyncSettings(new Syncfusion.EJ2.Inputs.UploaderAsyncSettings { SaveUrl = "Home/Save", RemoveUrl = "https://aspnetmvc.syncfusion.com/services/api/uploadbox/Remove" }).Render() 
 
</div> 
 
<script> 
    function onFileUpload(args) { 
        // getting the textbox object 
        var textBoxObj = document.getElementById("text").ej2_instances[0]; 
 
        args.customFormData = [{ 'text': textBoxObj.value }]; 
    } 
</script> 
 
We have created a sample based on your requirement. please find the sample here: https://www.syncfusion.com/downloads/support/forum/149368/ze/WebApplication1504313322  
 
To know more about passing additional parameter to server. Please refer the documentation link: https://ej2.syncfusion.com/aspnetmvc/documentation/uploader/how-to/add-additional-data-on-upload/  
 
If we misunderstood your query, please revert as with the comprehensive and exact scenario that you have faced. That will help us to provide exact solution at our end earliest. 
 
Regards, 
Sureshkumar P 


Loader.
Live Chat Icon For mobile
Up arrow icon