xz-pic Minimalist Image Hosting Online (with Source Code)

Publish: 2016-10-06 | Modify: 2016-10-11

Previously, Xiaoz shared a simple and practical image hosting program developed using the TuPianKu API. However, recently, TuPianKu has made some policy adjustments, and the free service can only store images from the past 6 months. Therefore, Xiaoz has developed a very simple image hosting program that stores images on his own local server.

Functionality

  • Uses Ajax for asynchronous uploading, so you don't have to refresh the page every time.
  • Automatically generates HTML and Markdown links after successful upload for easy use.
  • Backend developed using PHP, with only one file, upload.php, which contains simple code for image uploading.

Instructions

  • Simply place the source code in a directory on your website.
  • Modify the upload.php file to fill in your own domain near the screenshot.
  • Finally, access your domain to test the program.

sp160930_133359

Other Notes

  • Currently, the images can only be saved locally, but you can use a third-party CDN to add more functionality. For example, you can use VeryCloud CDN. If you want to use Qiniu Cloud Storage for acceleration, you can use Qiniu's mirroring feature and fill in the Qiniu domain in upload.php. The demo effect is shown in the following screenshot.

sp160930_133751

Demo URL: https://img.bsdev.cn/ Source code download: https://github.com/helloxz/xz-pic


Comments