Upload forbidden
Due to configured restrictions, you are not allowed to upload files at this time
Using PictShare
Basics
When you upload an image you'll get a link like this:
https://pictshare.net/abcef123.jpg
You can modify the size of the image by adding a size parameter to the URL. For example this will render the image in 800x600:
https://pictshare.net/800x600/abcef123.jpg
If you want to force the size to really be 800x600, you can use the "forcesize" parameter. It will still keep the aspect ratio but zoom in as needed to fit the dimensions
https://pictshare.net/800x600/forcesize/abcef123.jpg
There are many more of these modifiers and even filters available
Using the API
Basics
All API calls are done via GET or POST requests. The API will return JSON encoded data.
Base URLhttps://pictshare.net/api
Error handling
When the status is err there will always be a field "reason" that explains what went wrong.
{
"status": "err",
"reason": "File not a valid image"
}
Uploading an image
API call/upload
You can post a file using the POST variable file
CURL examplecurl -s -F "[email protected]" "https://pictshare.net/upload"
Output
{
"status": "ok",
"hash": "7eli4d.jpg",
"filetype": "image/jpeg",
"url": "http://localhost:8080/7eli4d.jpg",
"delete_code": "jxgat3wze8lmn9sqwxy4x32p2xm7211g",
"delete_url": "http://localhost:8080/delete_jxgat3wze8lmn9sqwxy4x32p2xm7211g/7eli4d.jpg"
}
Grabbing a URL
API call/upload?url=url of image
You can specify a URL in the POST or GET variable url that the call will try to download and process.
CURL examplecurl -s "https://pictshare.net/api/upload?url=https://pictshare.net/d2j1e1.png
Output
{
"status": "ok",
"hash": "ysj455.webp",
"filetype": "image/webp",
"url": "http://localhost:8080/ysj455.webp",
"delete_code": "4l0w04l4s42xddt2s5mrj1wikxz11l5z",
"delete_url": "http://localhost:8080/delete_4l0w04l4s42xddt2s5mrj1wikxz11l5z/ysj455.webp"
}
Uploading Base64 encoded content
It's also possible to upload supported files via Base64 strings by providing the base64 http parameter
API call/upload/?base64=base64 encoded string
CURL example
(echo -n "base64="; echo -n "data:image/jpeg;base64,$(base64 -w 0 Screenshot3.jpg)") | curl --data @- https://pictshare.net/api/upload
Output
{
"status": "ok",
"hash": "5e6alk.jpg",
"filetype": "image/jpeg",
"url": "http://localhost:8080/5e6alk.jpg",
"delete_code": "7ha2b5ccvsuvdd3qdnegzb2zqa9zxb5t",
"delete_url": "http://localhost:8080/delete_7ha2b5ccvsuvdd3qdnegzb2zqa9zxb5t/5e6alk.jpg"
}