0

I have a kendo uploader that I have created in Jquery

HTML:

  <div id="example" class="k-content">
     <input type="file" name="files" id="files" />
  </div>

Jquery:

  <script id="fileTemplate" type="text/x-kendo-template">
                <span class='k-progress'></span>
                <div class='file-wrapper'>
                    <h4 class='file-heading file-name-heading'>Name: #=name#</h4>
                    <h4 class='file-heading file-size-heading'>Size: #=size# bytes</h4>
                    <button type='button' class='k-upload-action'></button>
                </div>
    </script>

<script>
    $(document).ready(function () {
        $("#files").kendoUpload({
            multiple: true,
            async: {
                saveUrl: "NewFolder.aspx/UploadSubSRFiles",
                removeUrl: "Remove",
                autoUpload: false
            },
            upload: onUpload,
            template: kendo.template($('#fileTemplate').html())
        });


        function onUpload(e) {

            var paramsEmailDocs = "{'files':'" + JSON.stringify(e.files) + "'}"

            $.ajax({
                type: "POST",
                url: urlUploadFile,
                data: paramsEmailDocs,
                contentType: "application/json; charset=utf-8",
                dataType: "json",
                async: false,
                success: function (data) {

                }
            })
        }
    });
</script>

I want to have the file path of the selected files.

When we look into the e.files we get the extension, file name, size but not the file path. How can I get it. Any help will be highly appreciated.

Nitin Rawat
  • 209
  • 1
  • 5
  • 14

1 Answers1

2

This depends on the browser, some browsers share the full path, some does not. The information available in e.files is provided by the browser itself.

Petur Subev
  • 19,983
  • 3
  • 52
  • 68
  • Can u please help me in sorting it out: In the above scenario I want to upload the files, what should be my method on server side(in VB) and how can I get the posted files in that method. I can't use the form post in my application. – Nitin Rawat Apr 08 '14 at 06:18