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"
	}
]

zimg-host's People

Contributors

coldwinds avatar yorulez avatar ziggi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

zimg-host's Issues

xss

file_item_error.php?name=<script>alert("hi")</script>">

just remove the \ and its an xss
you need to fix this in this file and file_item.php

Button "FILE"

Hello
How can we change the name of the button "FILE"? (translation purposes)
I can't find it.

img.ziggy.org is down

Hey

Thank you for the great project! I'm using it for sreenshot automated sharring for the last year or two.

It seems that img.ziggy.org is down now. Let me know, please, if you're discounting the service ;)

Thanks!

file exists bug

yes of course it can be rare event but it is...
file based on md5(any data) must be checked out in cycle like
do
{
$file_name = md5( data string );
}
while( file_exists( SITE_ROOT . '/files/' . $file_name ) );

one way or another you NEED to check exists of data when you use hash function like md5, sha1 and so on.

Button to copy

Hello
As sugestion, its possible to add a button on the side of the direct link to "Copy Image", as a result to copy image link to our clipboard?

Shorter URL / Filename

What and where about in the PHP script would I change if I'd like to shorten the generated filename? After digging around a bit, it looks like it's using the MD5 of the image file to generate the name? I'd like to be able to shorten it to the length of imgur's (e.g. imgur.com/s9K5x.png). Thanks for your help!

API for CURL

Is it possible to add a api for CURL.
To query returned in text format to paste links to the forum etc?

question - changing upload folder location

Hi Ziggi,
Thank you for great script. Can you point me where I can change upload folder? basically I would like to have uload form in /a/zimg/ and images links in /a/file.png - is that even possible? Thank you.

BB Code

Hi there,
How can we change the direct image link to BB code embed code?
The code is simple, is just [img]www.image.com/1.jpg[/img]
I think it would be easy to change on php, but i don't know how.

Not Showing correct links

Its showing up like this after uploading a file
image

But if i navigate on the /file dir , they are there like /file/Q/k/QkTUIJRF.gif for example

columns css bug

columns crashed
so i suggest use at least 530px for result page or adjust font size for labels

Can't upload anything from URL

I get an error every time I try to upload images from URL ending with file type.
Tried various sites and every image gives me the error.
Is there something I have to config?

filesystem slow read behavior, possible errors

point:
files in one directory cannot be more than 100k or something. filesystem will stuck on read this directory. even delete one file can stop the system

anyway solution:
add at least 3 dir levels inner based on image name or other algorithm to prevent this type of errors

as example http://shots.m18.ru
but we use nginx to send static files by pattern as address to image is like domain/image/longlonglonghash.png
when real file not under root/image but under next directory files/s/o/m/e/longlonglonghash.png

Is their a way to customize it?

Hello.

I am currently trying to customize it, but cannot find the main page file nor the css file (if their is one). So I figured I'd ask if there was a way to customize it?

Thanks
Austin

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.