Download Google Drive file using javascript

空扰寡人 提交于 2019-12-02 10:37:36

TLDR;

You need to serialize datatable into a URL-encoded string first.


Explanation

var datatable = [url, title, type, filesize, fileext,id];

Here, you're creating datatable as an array

request.open("POST", "ajax-db-files/copy_drive_file.php?" + datatable, true);

request.send("datatable=" + datatable);

Then, in these two lines, you try to concatenate the array directly to the string, which casts the array to a string by calling .join(',') on the array.

What you need is to serialize the array into URL-encoded notation. If you're using jQuery, try var datatable = $.param({ url: url, title: title, type: type, filesize: filesize, fileext: fileext, id: id]); instead.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!