xz-pic Minimalist Image Hosting Platform Launch (Source Code Included)

xz-picsimple image hostingphp upload scriptself-hosted image serverminimalist image bed
Published·Modified·

Previously, Xiao Z's blog shared a simple and practical image hosting program developed using the Tie Tu Ku API. However, due to recent policy adjustments, the free tier now only allows saving images from the last 6 months. Therefore, Xiao Z used spare time to write an extremely simple image hosting program that stores images on their own local server.

Features

  • Uses AJAX asynchronous uploads, so you don't need to refresh the page every time.
  • Automatically generates HTML and Markdown links upon successful upload for easy usage.
  • Developed using PHP backend, consisting of only a single file upload.php. The code is very simple and focuses purely on image upload functionality.

Usage Instructions

  • Simply place the source code in a directory on your site.
  • Modify the upload.php file to fill in your own domain name near the screenshot area.
  • Finally, visit your domain to test.

xz-pic interface

Other Notes

Images are currently only supported for saving locally. However, you can integrate a third-party CDN, such as VeryCloud CDN. If you want to use Qiniu Cloud Storage for acceleration, you can utilize Qiniu's mirror storage feature and then fill in the Qiniu domain name in upload.php. The demo effect is shown in the screenshot below.

Qiniu integration demo

Demo Address: https://img.bsdev.cn/
Source Code Download: https://github.com/helloxz/xz-pic