damianz5/simple-file-server

Simple file server with file upload using API.

0.2.0 2021-10-16 18:43 UTC

This package is not auto-updated.

Last update: 2024-11-15 20:03:04 UTC


README

Build status on Linux

Scrutinizer Code Quality

Code Coverage

StyleCi.io

Latest Stable Version

SensioLabsInsight

Installation

composer create-project damianz5/simple-file-server

Test run

symfony server:start --port 8083 --no-tls

simple vanilla php client:

php example/simpleClient.php

should return (container name will be different)

response: {"status":"ok","collection_name":"5985f402600fd3d864de043a44f31b5f","files":["data\/container-5985f402600fd3d864de043a44f31b5f\/9cf3a175-test1.png"]}

Buzz Client (requires kriswallsmith/buzz): in progress

add new files to new collection:

curl -H 'AUTHKEY:supersecretcode1@' \
-F "image=@screenshot.png" -F "xx=@content.html" \
http://127.0.0.1:8083/api/upload

add new files to existing collection:

curl -H 'AUTHKEY:supersecretcode1@' \
-F "image=@screenshot.png" -F "xx=@content.html" \
http://127.0.0.1:8083/api/upload/ddf59d090e70094429414935c5ea53a1

list files:

curl -H 'AUTHKEY:supersecretcode1@' \
http://127.0.0.1:8083/api/list/ddf59d090e70094429414935c5ea53a1

using https://httpie.org/

http GET http://127.0.0.1:8083/api/list/beefbeefbeefbeefbeefbeefbeefbeef AUTHKEY:supersecretcode1@

IMPORTANT

  • change credentials keys in app/config/parameters.yml
  • check upload_max_filesize and post_max_size in your php.ini

TODO

  • add more tests
  • invalid uploaded files should return more information