Skip to content

怎么用API上传,麻烦可以写清楚吗 #109

Description

@huawuhen

由于项目介绍没说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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions