Skip to main content
Easton's stuff

Main navigation

  • Code
  • SnackLinux
  • Home

Breadcrumb

  1. Home

Base64 image uploading to Pasteros

Base64 image uploading to Pasteros

By Easton , 10 August, 2016

Pasteros now has JPEG handling abilities when pastes are uploaded with base64 data (see commit). Convert your image to base64 like this and view it by add .jpg to the end of the paste ! I also wrote a command line utility that uploads a selected screenshot area to Pasteros.

 

#!/bin/bash

function uploadImage {
 content=$(cat $1 | base64 -w 0)
 pasteid=$(curl -silent -H "Expect:" -X POST -d $content https://pasteros.io/api/v1/simplecreate | tail -1)
 echo "https://pasteros.io/$pasteid.jpg"  | xclip -selection c
}

DISPLAY=:0.0 scrot -s "shot.jpg" 
uploadImage "shot.jpg"
rm "shot.jpg"
notify-send "Done"

via https://pasteros.io/57aada0276bf8

Tags
pasteros
php

Navigation

  • GitHub Profile
  • SnackLinux
  • Popular pages
    • Restoring a Macintosh Plus
    • Getting root access on a $10 Aliexpress Wifi repeater
    • Remote code execution on no-name wifi repeaters: Part 2
    • Building your own handheld GPS with an ESP32
    • Remote code execution with Hitron CGNM-2250
    • NES controller and a RaspberryPi
    • 4000 series CMOS 24 hour clock
  • Toyota Overland
RSS feed



 

Powered by Drupal