Can't retrieve file content via download URL

前端 未结 2 1488
鱼传尺愫
鱼传尺愫 2021-01-22 12:09

Since about an hour, I can\'t retrieve file content via the download URL attribute.

Each time I try to get it, API answers a 401 (unauthorized error).

Here\'s th

2条回答
  •  青春惊慌失措
    2021-01-22 12:46

    You can use

    resp.alternateLink;
    resp.webContentLink;
    

    i got stucked in the same issue a day back , using downloadUrl to get the content but got it with webContentLink.

    var request = gapi.client.drive.files.list();
                    request.execute(function (resp) {
    
    resp.alternateLink;
        resp.webContentLink;
    });
    

提交回复
热议问题