I want to download Google Drive file using javascript to my server when i click on Google Drive picker but cannot get the file downloaded. I have been searching if for 4 day
You need to serialize datatable
into a URL-encoded string first.
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.