Build a Simple Image Hosting Program Using the Tietu API
What is an image hosting program? It is an online space dedicated to storing images while allowing you to link to them externally. Tietu offers free services with API interfaces. I wrote a simple and practical image hosting program during my spare time. The code is very simple, consisting of only a single-page HTML file and a JavaScript script, with no dependency on any backend scripts. Below is a detailed introduction and usage guide.
1. Register a Tietu Account
First, visit the Tietu official website to register as a member.
2. Generate a Token
The Token is required when uploading images. After successfully registering and logging in, click here to generate one. First, select a target album, choose the upload method as "Local Upload," and finally click "Generate." After generation, do not forget to save the Token, as it will be needed later.\n

3. Download Source Code
The code is hosted on GitHub. Download it here:
4. Add the Token
After downloading the code to your local machine, use a text editor (such as Notepad++), not the default Notepad. Fill in the Token obtained in Step 2 at approximately line 26, as shown in the screenshot below.

5. Deploy the Code
Deploy the code to your web server. Once deployed, you can access and upload images via URL. For a demo, please visit:

6. Manage Images
Images uploaded via the API can be viewed and managed in the Tietu backend.
Pros: The code is simple and practical. Cons: If the Tietu service goes down, the images may also become inaccessible, and the images are not stored on your own server. Therefore, this method is suitable for temporary image hosting. For permanent image hosting, it is recommended to develop a complete solution independently without relying on third-party APIs.