Direct file upload to Google Drive using URL

I’m looking for a way to upload files directly to Google Drive using some kind of URL endpoint. Let me explain what I’m trying to do.

I have files stored on my web server, like https://mywebsite.com/document.pdf, and I want to transfer them straight to Google Drive without downloading them first to my computer. I was wondering if there’s a simple URL-based method to accomplish this.

For instance, something similar to:

https://drive.google.com/upload?source=https://mywebsite.com/document.pdf

Is there a built-in Google Drive feature or API endpoint that supports this type of direct URL-to-Drive upload? What would be the best method to achieve this functionality?

I’ve dealt with this exact scenario before when building a document management system. The reality is that Google Drive’s API requires you to act as a middleman server to facilitate this transfer. What I ended up implementing was a simple endpoint on my server that accepts the source URL as a parameter, downloads the file to temporary storage, then immediately uploads it to Google Drive using the API before deleting the temporary file. This approach works well and keeps the file transfer server-side without requiring client downloads. You’ll need to set up service account credentials for authentication, which is actually more reliable than OAuth for server-to-server operations. The whole process typically takes just a few seconds depending on file size and your server’s bandwidth.

yeah there’s no magic url trick for this unfortunately. i built something similar using google apps script - just write a function that fetches your file with UrlFetchApp and saves it with DriveApp.createFile(). works pretty well for smaller files but has timeout limits around 6 minutes.

Unfortunately, Google Drive doesn’t offer a straightforward URL-based upload method as you might be looking for. The most viable option is to utilize the Google Drive API, which involves proper authentication and some programming experience. From my past experience, I created a small server-side script that retrieves the file from a remote source and uploads it to Google Drive via the API. You will need to configure OAuth credentials and manage the file upload programmatically. Additionally, Google Apps Script can be used to fetch external URLs and save them directly to Drive, although it does have limitations regarding file size. Ultimately, there isn’t a simple URL parameter that can accomplish this; an intermediary script is necessary to handle the upload process.