Base64file uploading to cloudinary is not working
@AnshShah77 已經在處理了。
開始於 2023年10月6日。
評估
研究方向
首先使用提供的Base64內容重現uploadImageToCloudinary函式,並檢查cloudinaryClient.Upload.Upload回傳的錯誤。確定這次上傳未成功的原因;當Base64圖像成功上傳並回傳有效的UploadResult時,即表示完成。
由索引模型根據 Issue 內容生成。
描述
`
func uploadImageToCloudinary(base64str, name string) (*uploader.UploadResult, error) {
cloudinaryURL := os.Getenv("CLOUDINARY_URL")
cloudinaryClient, err := cloudinary.NewFromURL(cloudinaryURL)
if err != nil {
return nil, err
}
formattedString := fmt.Sprintf("data:image/jpeg;base64,%s", base64str)
uploadParams := uploader.UploadParams{
PublicID: name,
UseFilename: true,
UniqueFilename: true,
}
// Upload the Base64 encoded content
result, err := cloudinaryClient.Upload.Upload(context.Background(), formattedString, uploadParams)
if err != nil {
return nil, err
}
return &result, nil
}
`
I tried to do like this and also I tried many but just not working
- 主要語言
- Go
- 星號
- 51
- 分支
- 25
- PR 合併指標
- 30 天內沒有已合併 PR
環境準備
- 沒有 Dockerfile 或 Docker Compose 檔案
- 有 Pull Request 範本
- 閱讀貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
cloudinary/cloudinary-go 的其他 Issue
-
Introduce custom error types可能重新可做 @const-cloudinary 於 2104 天前認領,目前沒有進行中的 PR。 未關閉
cloudinary/cloudinary-go#7 · 5 則留言 · 1 個 reaction · 已指派 2 人 ·
查看 cloudinary/cloudinary-go 的全部 Issue
相似的 Issue
-
needs-triage typo
難度 1/5 1 小時以內 新手友好度 88/100
llm-d-incubation/llm-d-scaling-manager#122 ·
維護者通常 1 天內回覆
-
good first issue severity: low tech-debt
難度 2/5 半天 新手友好度 75/100
TMHSDigital/subenum#329 ·
維護者通常 1 天內回覆
-
[Bug] Backend summarize min() / max() panics when a field has no numeric values可能已有人在做 @weng5e 今天認領。 未關閉
難度 2/5 1-3 小時 新手友好度 64/100
grafana/grafana-infinity-datasource#1832 ·
維護者通常 1 天內回覆
-
tech-debt
難度 2/5 1-3 小時 新手友好度 82/100
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 62/100
GillMacedo/godebugdiff#13 ·