How to upload an image to google drive using gapi and react

前端 未结 2 1867
长发绾君心
长发绾君心 2020-12-21 15:39

I\'m trying to upload an image to google drive. I followed this tutorial for uploading files, I can upload a simple file but when I try to upload an image I get a corrupted

2条回答
  •  孤城傲影
    2020-12-21 16:34

    I created a customization on top of react-uploady, called drive-uploady that makes it trivial to upload to google drive with all the power of Uploady: hooks, UI components, progress, etc.

    for example:

    import React from "react";
    import DriveUploady from "drive-uploady";
    import UploadButton from "@rpldy/upload-button";
    
    export const App = () => {
    
        return                 
                Upload to Drive
            ;
    };

    Is all you need to render an upload button that logs in the user to Drive and uploads.

提交回复
热议问题