Git Product home page Git Product logo

litefilesystem.js's Introduction

litefileserver.js

LiteFileServer.js is front-end and back-end library that allows javascript apps to store resources (images, text-files, binaries) in the server. It comes with its own users and units system that allow every user to partition its own space and share it among other users.

Some of the features:

  • REST HTTP API for storing, listing, moving, updating or deleting files.
  • Basic users (register, login, delete, administration )
  • Independent file tree per user
  • Units, users can have several units to store files and share with other users
  • Files can have thumbnail image and metadata

The server side is coded in PHP and comes with useful scripts for administration.

Installing

Check the install guide to see a step by step process of how to install it in your server.

Usage

Once installed you can include the litefileserver.js script in your project you must first login:

var lfs = LFS.setup("myhost", onReady );
var session = null;

//check to see if the server is available
function onReady()
{
   LFS.login( username, password, onLogin );
}

function onLogin( my_session, err )
{
   if(!my_session)
      throw("error login in:", err);
   session = my_session;
}

Once logged you can fetch for files and folders using the session:

session.getUnitsAndFolders( function(units) {
  //units contain info about every unit and which folders it has
});

session.getFiles( unit_id, folder, function( files ) {
  //info about the files in that folder
});

Check the LFS.Session class for more info about all the actions you can perform (create folders, units, give privileges, upload files, etc).

Also check the demo in the src folder to see an usage of the system.

Feedback

You can write any feedback to [email protected]

litefilesystem.js's People

Contributors

jagenjo avatar atlasan avatar coderofsalvation avatar

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.