diff --git a/api/base64.php b/api/base64.php index 4aeb9be..090b9da 100644 --- a/api/base64.php +++ b/api/base64.php @@ -33,6 +33,7 @@ if($_REQUEST['base64']) base64ToFile($data, $tmpfile); + //get the file type $type = getTypeOfFile($tmpfile); diff --git a/rtfm/API.md b/rtfm/API.md index c130bfb..823ad26 100644 --- a/rtfm/API.md +++ b/rtfm/API.md @@ -142,4 +142,27 @@ Answer from the server: "type": "video/mp4", "type_interpreted": "mp4" } +``` + +# base64.php +- URL https://pictshare.net/api/base64.php +- Method: POST/GET +- Query var name: base64 +- Answer: JSON + +## Example + +Upload local image "test.jpg" to pictshare + +```(echo -n "base64="; echo -n "data:image/jpeg;base64,$(base64 -w 0 test.jpg)") | curl --data @- https://pictshare.net/api/base64.php``` + +```json +{ + "status": "ok", + "hash": "lpl119.jpg", + "url": "https://dev.pictshare.net/lpl119.jpg", + "filetype": "jpeg", + "delete_code": "z0e1mdo8szxnauspxp2f080e4wd4ycf2", + "delete_url": "https://dev.pictshare.net/delete_z0e1mdo8szxnauspxp2f080e4wd4ycf2/lpl119.jpg" +} ``` \ No newline at end of file