Quantcast
Channel: SharePoint 2013 - Development and Programming forum
Viewing all articles
Browse latest Browse all 7589

upload mutiple files using rest api

$
0
0

Hi,

I am using restapi to upload files its working file if I call method directly like below

working fine

 <button type="button" class="btn btn-primary" onclick="uploaddossier(false);">
                                        Save as Draft
                                    </button>

Problem:

if I call "uploaddossier()" within function like below

  <button type="button" class="btn btn-primary" onclick="IssendApproval();">
                                        Send For Approval
                                    </button>

  function IssendApproval() {
        // if ($('#chkwfstatus').is(':checked')) {
        //  if (window.confirm('Do you want to send for approval now then press "ok" ,if yuou want to send later then press cancel.?')) {
      //  if (window.confirm('Are you sure to sent for approval.?')) {
            $('#hid_flagIssendforapproval').val('1');
            if ($('#getFile').get(0).files.length > 0) {
                uploaddossier(true);
            }
            
            clearui();
        //}
        return false;
        //}
    }

then its not working its showing below error

what to do get rid of this error.. as I mentioned if I call "  uploaddossier(true); " ,directly not within function so it works fine

Kindly help

Thanks


Viewing all articles
Browse latest Browse all 7589

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>