This is a migrated thread and some comments may be shown as answers.

Providing files to AsyncUpload from a different frame.

3 Answers 59 Views
AsyncUpload
This is a migrated thread and some comments may be shown as answers.
Justin Kohnen
Top achievements
Rank 1
Justin Kohnen asked on 04 Jan 2016, 09:29 PM

I have a frame that a user can drag and drop files to. My AsyncUpload control is in a separate iframe.

I am currently able to pass the dataTransfer.files object between frames... is there a way I can add the individual file objects of the dataTransfer.files array to the AsyncUpload control using JavaScript?

I can't seem to find a function that will let me do it.

 

Thank you in advance,

Justin

3 Answers, 1 is accepted

Sort by
0
Nencho
Telerik team
answered on 07 Jan 2016, 03:36 PM
Hello Justin,

I am not quite sure about the scenario that you aim to achieve. Could you please elaborate e bit more on what exactly you need to implement?

Regards,
Nencho
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Justin Kohnen
Top achievements
Rank 1
answered on 11 Jan 2016, 04:46 PM

I'll simplify my scenario. I want to be able to make a custom drag/drop zone for files and then, using javascript, add it to the asyncUpload control on the client side.

Here is a rough code snippet of what I'm talking about.

---------------------------------

<script> 

function drop(ev) {

    ev.preventDefault();
    var droppedFiles= ev.dataTransfer.files;
     var uploadcontrol = $find("<%= AsyncUpload1.ClientID %>");

     /// How do I add the content of droppedFiles to UploadControl
}
</script>

<div id="div1" ondrop="drop(event)" ></div>

<telerik:RadAsyncUpload runat="server" ID="AsyncUpload1"
                            HideFileInput="true"
                            Skin="Telerik"
                            MultipleFileSelection="Automatic"
                            AllowedFileExtensions=".jpeg,.jpg,.png,.doc,.docx,.xls,.xlsx" />

0
Nencho
Telerik team
answered on 14 Jan 2016, 01:37 PM
Hello Justin,

I am afraid that such dynamically supply with certain file is not possible for the upload controls due to security reasons. You can, however, set the DropZone property of the RadAsyncUpload, but I am afraid that this also won't be applicable in such iframe scenario.

Regards,
Nencho
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
AsyncUpload
Asked by
Justin Kohnen
Top achievements
Rank 1
Answers by
Nencho
Telerik team
Justin Kohnen
Top achievements
Rank 1
Share this question
or