damianz5/simple-file-server

使用API上传文件的简单文件服务器。

0.2.0 2021-10-16 18:43 UTC

This package is not auto-updated.

Last update: 2024-09-20 19:14:46 UTC


README

Build status on Linux

Scrutinizer Code Quality

Code Coverage

StyleCi.io

Latest Stable Version

SensioLabsInsight

安装

composer create-project damianz5/simple-file-server

测试运行

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

简单的PHP客户端

php example/simpleClient.php

应返回(容器名称将不同)

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

Buzz客户端(需要 kriswallsmith/buzz):进行中

向新集合添加新文件

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

向现有集合添加新文件

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

列出文件

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

使用 https://httpie.org/

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

重要

  • app/config/parameters.yml 中更改凭证密钥
  • 检查您的 php.ini 中的 upload_max_filesizepost_max_size

待办事项

  • 添加 更多 测试
  • 无效的上传文件应返回更多信息