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!
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
if you have an external url, you can use this API 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
in combination with this (which takes the response fromt he above 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
1 Like