首页 > 解决方案 > GitHub个人资料图片上传不起作用

问题描述

这是我尝试在 GitHub 上上传约 1MB 图片作为个人资料图片时得到的响应:

POST https://github.com/upload/policies/avatars 422 (Unprocessable Entity)
errors: [{resource: "Avatar", code: "custom", field: "size", message: "size is not included in the list"}]
    0: {resource: "Avatar", code: "custom", field: "size", message: "size is not included in the list"}
        code: "custom"
        field: "size"
        message: "size is not included in the list"
        resource: "Avatar"

我从控制台和 Chrome DevTools 网络选项卡中获取了这个,因为前端绝对没有任何反馈。这里可能是什么问题?我禁用了所有扩展并尝试了 Firefox,但问题仍然存在。

标签: google-chromefirefoxgithubgoogle-chrome-devtools

解决方案


根据 GitHub,他们的个人资料图片的最大文件大小为 1 MB,这就是他们建议将其保持在 500x500 像素左右的原因。不幸的是,他们的 UI 看起来并没有真正显示错误。


推荐阅读