CloudFile-API

CloudFile is a simple file storage solution that can be consumed via an API. Useful for all your projects, CloudFile allows the storage of files (images, videos, texts, applications...) in a public or private cloud. Documentation

Getting Start

Installation

git clone https://github.com/Mediashare/CloudFile-API
cd CloudFile-API
composer install
bin/console doctrine:schema:update --force
php -S localhost:8000 -t public/
1
2
3
4
5

Api endpoint

  • / List file(s)
  • /upload Upload file(s)
  • /info/{id} File informations
  • /show/{id} Show file
  • /download/{id} Download file
  • /remove/{id} Remove file

Usages

Use curl command line tool

curl \
  -F "file=@/home/user1/Desktop/image1.jpg" \
  -F "file2=@/home/user1/Desktop/image2.jpg" \
  localhost:8000/upload
1
2
3
4

Use ApiKey for private cloud

curl \
  -F "file=@/home/user1/Desktop/image1.jpg" \
  -H "ApiKey: xxxxxxx" \
  localhost:8000/upload
1
2
3
4

Add metadata to file(s)

You can add metadata to file(s) with GET & POST methods.

curl \
  -F "file=@/home/user1/Desktop/image1.jpg" \
  -F "category=image" \
  localhost:8000/upload?foo=bar
1
2
3
4
Last Updated: 1/31/2020, 3:24:21 PM