Providing files to AsyncUpload from a different frame.

4 posts, 0 answers
  1. Justin Kohnen
    Justin Kohnen avatar
    4 posts
    Member since:
    Jun 2008

    Posted 04 Jan Link to this post

    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

  2. Nencho
    Admin
    Nencho avatar
    1458 posts

    Posted 07 Jan Link to this post

    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
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Justin Kohnen
    Justin Kohnen avatar
    4 posts
    Member since:
    Jun 2008

    Posted 11 Jan in reply to Nencho Link to this post

    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" />

  5. Nencho
    Admin
    Nencho avatar
    1458 posts

    Posted 14 Jan Link to this post

    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
Back to Top