Here lives a simple, modernized, stand-alone implementation of the Pomf API commonly seen in screenshot tools such as ShareX and Katana.
The purpose of this project is for those who want to self-host their screenshots without a frontend as seen in the original Pomf project.
- Clean, modernized code-base with PSR-2.
- Uses Bulletproof to securely (and properly) handle image uploads.
- Configurable token to prevent outside uploading.
- Customizable screenshot filenames with the ability to set a slug and timestamp (e.g.
Screenshot_2019-03-02_13-12-57.png
) or as a randomized string using the Hashids library.
$ composer create-project log1x/pomf screenshots
- Set configuration in
config.php
. - Upload the
pomf
folder contents to your server. - Configure your Pomf App with your URL (e.g.
https://example.com/screenshots/upload.php?token=secret
)
For testing purposes, you can use curl
:
$ curl -i -X POST -F 'file=test@path/to/test.jpg' 'https://example.com/screenshots/upload.php?token=secret'
or httpie
:
$ http --form 'https://example.com/screenshots/upload.php?token=secret' 'test@path/to/test.jpg'