API Cloudfile - Documentation

Cloudfile est un système de fichier consumable via une API. Utilisable dans tous vos projets, l'outil donne accès à tous vos documents (images, videos, textes, applications...) via un cloud privée ou publique.

Features

  • File hosting
  • Volume publique ou privé
  • Rendu graphique des documents
  • Prise en charge de plusieurs disque dur
  • Backup avec une autre instance de Cloudfile

Installation

git clone https://github.com/Mediashare/CloudFile-API
cd CloudFile-API
composer update
chmod -R 777 var
bin/console cloudfile:install \ 
  --username "Admin" \ 
  --password "Admin" \ 
  --disk-name "MobyDisk" \
  --disk-path "${PWD}/var/stockage" \ 
  --backup-host "" \ 
  --backup-apikey "" \ 
  --cloudfile-password "MyCloudFilePassword"
php -S localhost:8000 -t public/

Pour finir l'installation, rendez-vous sur la page http://localhost:8000/install

API

Volume

Création de volume

Si vous êtes créateur de l'instance, vous pouvez bloquer la création de volume via l'ajout d'un password à votre cloudfile instance (cloudfile-password).

curl \
    -X POST \
    -F "name=My first volume" \
    -F "size=5" \ # Gb
    -F "cloudfile_password=MyCloudFilePassword" \ # If not blank 
    https://api.cloudfile.tech/volume/new

Info

curl \
    -H "ApiKey: <VOLUME_APIKEY>"
    https://api.cloudfile.tech/volume

Edition

curl \
    -H "ApiKey: <VOLUME_APIKEY>"
    -F "name=Update name"
    https://api.cloudfile.tech/volume/edit

Néttoyer

curl \
    -H "ApiKey: <VOLUME_APIKEY>"
    https://api.cloudfile.tech/volume/clear

Reset ApiKey

curl \
    -H "ApiKey: <VOLUME_APIKEY>"
    https://api.cloudfile.tech/volume/reset/apikey

Suppression

curl \
    -H "ApiKey: <VOLUME_APIKEY>"
    https://api.cloudfile.tech/volume/delete

File

Si le fichier appartient à un volume publique, vous n'êtes pas obligé d'ajouter la clef api dans les headers.

Upload

curl \
    -H "ApiKey: <VOLUME_APIKEY>"
    -F "file=@/path/to/file"
    -F "foo=bar" # metadata parameter(s)
    https://api.cloudfile.tech/upload

Info

curl \
    -H "ApiKey: <VOLUME_APIKEY>"
    https://api.cloudfile.tech/info/{id}

Affichage

curl \
    -H "ApiKey: <VOLUME_APIKEY>"
    https://api.cloudfile.tech/show/{id}

Download

curl \
    -H "ApiKey: <VOLUME_APIKEY>"
    https://api.cloudfile.tech/download/{id}

Suppression

curl \
    -H "ApiKey: <VOLUME_APIKEY>"
    https://api.cloudfile.tech/remove/{id}

Liste des fichiers dans un volume

curl \
    -H "ApiKey: <VOLUME_APIKEY>"
    https://api.cloudfile.tech/list

Search

curl \
    -H "ApiKey: <VOLUME_APIKEY>"
    https://api.cloudfile.tech/search?{nom_du_fichier}

MarquandT

Ethical Hacker ~ Web Developper ~ File Hosting Provider ~ Crypto Enthusiast ~ Automation Expert Bitcoin donation: 32Uu4NKGnxSPC7UukYXVyRHwbppbQpKVki

1231