Code Monkey home page Code Monkey logo

zimg-host's Introduction

zimg-host

Simple image hosting service

Demo

http://img.ziggi.org/

Backend requirement

  • PHP >= 5.3.0
  • GD extension

Installation

  • Copy files into your website directory (subdirectories are supported)
  • Change config.php if you need
  • Make sure that the file/ directory is writable by web server

Config for nginx

If you are using nginx instead Apache, this configuration example can be useful to you:

location / {
	try_files $uri $uri/ /index.php?$args;
}

Usage in CURL

You can upload images using CURL.

Some examples:

curl -F files[][email protected] http://img.ziggi.org/api/upload.php
curl -F files[][email protected] -F files[][email protected] http://img.ziggi.org/api/upload.php
curl -F urls[]=http://i.imgur.com/VCcArdF.jpg?1 http://img.ziggi.org/api/upload.php
curl -F urls[]=http://i.imgur.com/VCcArdF.jpg?1 -F urls[]=http://i.imgur.com/hdsdwsS.jpg?1 http://img.ziggi.org/api/upload.php

Password protect upload:

curl -u whatever:YOUR_PASSWORD -F urls[]=http://i.imgur.com/VCcArdF.jpg?1 http://img.ziggi.org/api/upload.php

example of result string (formatted for readability):

[
	{
		"name":"image1.jpg",
		"type":2,
		"size":
		{
			"width":420,
			"height":336,
			"filesize":26834
		},
		"error":
		{
			"upload":0,
			"type":0,
			"size":0
		},
		"url":"mijhmyhS.jpg"
	},
	{
		"name":"image2.jpg",
		"type":2,
		"size":
		{
			"width":703,
			"height":442,
			"filesize":88604
		},
		"error":
		{
			"upload":0,
			"type":0,
			"size":0
		},
		"url":"GyDIPAGC.jpg"
	}
]

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.