Telegraph-Image
Telegraph-Image copied to clipboard
怎么用API上传,麻烦可以写清楚吗
由于项目介绍没说API,我摸索出,API上传地址https://yuming.com/upload POST参数:file 可我写了一个批处理根本上传不了
@echo off
setlocal enabledelayedexpansion
REM 设置API上传接口和参数名
set upload_url=https://yuming.com/upload
set param_name=file
REM 设置图片文件夹路径
set image_folder=C:\Users\Administrator\Pictures\zzz
REM 创建一个空文件用于存储链接地址
echo. > image_links.txt
REM 循环遍历文件夹中的所有图片文件
for %%i in ("%image_folder%\*.*") do (
echo Uploading %%i
curl -s -F %param_name%=@%%i %upload_url% | findstr /C:"url" >> image_links.txt
)
echo Image upload completed
REM 显示链接地址
echo Image links:
type image_links.txt
pause
HTTPS 证书过期
HTTPS 证书过期
这个才是我的真实域名https://tu.homwei.link/upload 大佬帮忙指导下
建议:不要clone项目再上传cloudflare worker ,直接在worker中访问github导入(fork),前者操作有bug. 图床逻辑慢简单,实在不行自己撸一个。
已通过AI成功找到方法,关闭
已通过AI成功找到方法,关闭
能分享下成功的代码吗,感谢!
已通过AI成功找到方法,关闭
能分享下成功的代码吗,感谢!
@echo off
set /p filepath="Enter the path to the image file: "
set response=%TEMP%\upload_response.txt
curl -X POST -F "file=@%filepath%" https://yourname.com/upload > "%response%"
set /p image_url=< "%response%"
echo Image URL: https://yourname.com/file%image_url:~16,-3%
pause