Giter Site home page Giter Site logo

sharepoint-request-uploader's Introduction

SharePoint Request Uploader

This is a very small cli tool with which you can upload a file from your terminal directly to a sharepoint file request.

Important This tool is only for submitting to sharepoint file requests, and not ordinary file uploads or anything else.

Purpose

On the Microsoft SharePoint, there is a feature called "Request files". With it, a user can create a link to a folder, with which anyone can upload files to it. This is often used to collect documents from various people, without trusting them to read each others uploads.

Such an upload link can be created in most SharePoints using the right-click menu of a folder: Image showing the SharePoint OneDrive user interface

This results in a link that looks something like this:

https://tenant.sharepoint.com/:f:/g/personal/some_user/Ab_Hgz79wnd73t6dga6enga436dhjbj978eub168ghs1u

If this link is opened in a browser, it shows a page through which it is easy to upload files to said folder by selecting them.

Note The "Request file" feature is not present on every SharePoint or OneDrive instance. For example when using your personal OneDrive account, this feature is not available.

This cli enables you to upload files to such a request easily directly from the terminal. You can simply specify a file and a request url, and the cli obtains the required tokens, opens a session, and uploads the file.

Usage

The usage of this cli is straight forward. Refer to the help page:

Usage: sharepoint-request-uploader [OPTIONS] <FILE> <URL>

Arguments:
  <FILE>  File to upload
  <URL>   File request url shared by the source

Options:
  -n, --name <NAME>          Name of the submitter (Firstname Lastname)
  -f, --filename <FILENAME>  Name of the file in the onedrive folder
  -h, --help                 Print help
  -V, --version              Print version

This page can be displayed using the --help option.

  • <FILE> is the path to the file you want to upload.
  • <URL> is the url that we talked about in Purpose.
  • With the --name option you can enter a name which is shown to the owner of the request url. A firstname and lastname are both required. This defaults to Unknown User.
  • With the --filename option you can specify the name the file will have in the OneDrive folder once uploaded. This defaults to the local name of the file. This is actually an option which is not available over the official upload webpage, so use it with care.

So this is an example of how you could use the cli:

sharepoint-request-uploader --name "Marcel D'Avis" --filename "file-from-marcel.txt" file.txt https://tenant.sharepoint.com/:f:/g/personal/some_user/Ab_Hgz79wnd73t6dga6enga436dhjbj978eub168ghs1u

Installation

To install and use this cli, you need to compile it from source. Technically, it should be able to compile on every platform, since it does not use any platform specific things. Note however, that I have only tested it on Linux.

To install it on Linux, make sure that you have a rust toolchain and the cargo build system installed correctly. Then, clone this repository:

git clone https://github.com/VirtCode/sharepoint-request-uploader

Now move into the new directory and build and install it via cargo:

cargo install --path .

Great! It should now be available in your path.

Contributing

As you may see from the code, this tool is very simple and bare bones. However, if you need some extra functionality, better console output, or sleeker error handling, don't hesitate to contribute.

License

This small project is licensed under the MIT license. Refer to the LICENSE.txt file for more information.

sharepoint-request-uploader's People

Contributors

virtcode avatar

Stargazers

 avatar  avatar

Watchers

 avatar

Forkers

doiiido

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.