Giter Site home page Giter Site logo

viper3400 / filesync Goto Github PK

View Code? Open in Web Editor NEW
0.0 0.0 1.0 54 KB

FileSync is very basic implementation of .Net GoogleDriveAPI v3. It uploads a single file to Google Drive cloud storage, using a Google service account. It grants permission to this file to another Google Drive account.

Home Page: https://viper3400.github.io/FileSync/

License: Other

C# 100.00%
fileuploader googledrive netcore upload

filesync's People

Contributors

viper3400 avatar

Watchers

 avatar  avatar

Forkers

xwyangjshb

filesync's Issues

Remove Win32 dependency

In order to run in a alpine linux docker container the win32 dependency from Drive.Api has to be removed.

using Microsoft.Win32;

        // tries to figure out the mime type of the file.
        private static string GetMimeType(string fileName)
        {
            string mimeType = "application/unknown";
            string ext = System.IO.Path.GetExtension(fileName).ToLower();
            //TODO: Eliminate Win32 dependency
            Microsoft.Win32.RegistryKey regKey = Microsoft.Win32.Registry.ClassesRoot.OpenSubKey(ext);
            if (regKey != null && regKey.GetValue("Content Type") != null)
                mimeType = regKey.GetValue("Content Type").ToString();
            return mimeType;
        }

Maybe we can use https://github.com/hey-red/Mime

Pass Metadata in Body When Creating a GoogleDrive File

In order to get #4 implemented at least the creation and modification time must be set, otherwise it seems to be empty in DriveApi.cs method UploadFile:

File body = new File();
body.Name = System.IO.Path.GetFileName(_uploadFile);
body.Description = "File uploaded by FileSync";
body.MimeType = GetMimeType(_uploadFile);
body.Parents = new List<string> { _parent };
body.WritersCanShare = true;

Add Housekeeping Features

Files with a certain file age should be deleted.

Jaxx.FileSync.exe [global] delete agedfiles -a | --age [30] -f | --folder [foldername]

  • #6 must be solved before this can take place

Taking the current timestamp and delete back for x days won't be good if a backup haven't run for y days without being noticed - this could probably mean loss of backups.

  • For better backup strategy maybe the last x files should be kept while all older ones were deleted.
  • Or we look at the latest modified days to determine the "agedfiles" and go back from their instead of taking the current time.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.