Simple file server
, (*1)
, (*2)
, (*3)
, (*4)
, (*5)
, (*6)
Installation
composer create-project damianz5/simple-file-server
Test run
symfony server:start --port 8083 --no-tls
simple vanilla php client:, (*7)
php example/simpleClient.php
should return (container name will be different), (*8)
response: {"status":"ok","collection_name":"5985f402600fd3d864de043a44f31b5f","files":["data\/container-5985f402600fd3d864de043a44f31b5f\/9cf3a175-test1.png"]}
Buzz Client (requires kriswallsmith/buzz
):
in progress, (*9)
add new files to new collection:, (*10)
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:, (*11)
curl -H 'AUTHKEY:supersecretcode1@' \
-F "image=@screenshot.png" -F "xx=@content.html" \
http://127.0.0.1:8083/api/upload/ddf59d090e70094429414935c5ea53a1
list files:, (*12)
curl -H 'AUTHKEY:supersecretcode1@' \
http://127.0.0.1:8083/api/list/ddf59d090e70094429414935c5ea53a1
using https://httpie.org/, (*13)
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