# How Do You Upload a file on the backend from Google Drive to Wix using code?

**URL:** <https://forum.wixstudio.com/t/how-do-you-upload-a-file-on-the-backend-from-google-drive-to-wix-using-code/57968>\
**Category:** Ask the community\
**Tags:** wix-media-backend, wix-editor, question, code, wix\
**Created:** [April 8, 2024, 4:47pm UTC](https://forum.wixstudio.com/t/how-do-you-upload-a-file-on-the-backend-from-google-drive-to-wix-using-code/57968 "2024-04-08T16:47:36Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![imek2477](https://avatars.discourse-cdn.com/v4/letter/i/3ab097/32.png) [@imek2477](https://forum.wixstudio.com/u/imek2477)\
**Post date:** [April 8, 2024, 4:47pm UTC](https://forum.wixstudio.com/t/how-do-you-upload-a-file-on-the-backend-from-google-drive-to-wix-using-code/57968/1 "2024-04-08T16:47:36Z")

</div>

**Question:**  
How Do You Upload a file on the backend from Google Drive to Wix Using Code?

**Product:**  
Wix Editor

**What are you trying to achieve:**  
I have media in Google Drive that I want to automatically upload and organize in Wix to use later instead of doing it manually. Things like pictures and videos for editing sites to keep things organized. My theory is there is probably a way between Google Drive API, Wix Media Backend or a combination of both along with the file ID, but I’m having a hard time figuring out exactly what I need to do.

Your guidance is appreciated!

---

<div class="post-metadata">

**Author:** ![amandam](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/amandam/32/79539_2.png) [@amandam](https://forum.wixstudio.com/u/amandam)\
**Post date:** [April 8, 2024, 7:47pm UTC](https://forum.wixstudio.com/t/how-do-you-upload-a-file-on-the-backend-from-google-drive-to-wix-using-code/57968/2 "2024-04-08T19:47:20Z")

</div>

You can use wix-fetch to interact with the google API and once you get the response, assuming it is in a format that will be accepted by the API, you can then trigger the upload.

if you need to upload a buffer, look at this API

> **[upload - Velo API Reference - Wix.com](https://www.wix.com/velo/reference/wix-media-backend/mediamanager-obj/upload)**
>
> Uploads a file to the Media Manager from a buffer. The upload() function returns a Promise that resolves to information about the newly uploaded file. Video ...

if you have an external url, you can use this API [https://www.wix.com/velo/reference/wix-media-v2/files/importfile](https://www.wix.com/velo/reference/wix-media-v2/files/importfile)

And finally, if you are looking to generate an upload url, this is the API you will need [https://www.wix.com/velo/reference/wix-media-v2/files/generatefileuploadurl](https://www.wix.com/velo/reference/wix-media-v2/files/generatefileuploadurl)

in combination with this (which takes the response fromt he above API) [https://www.wix.com/velo/reference/wix-media-v2/files/upload-api](https://www.wix.com/velo/reference/wix-media-v2/files/upload-api)

What you will need to use depends on what google gives you and how and the size of the files. Take a read through the documentation to decide what works best for your use case
