Base64file uploading to cloudinary is not working

未關閉
#82 2 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

@AnshShah77 已經在處理了。

開始於 2023年10月6日。

評估

難度
3/5
預估耗時
1-2 天
新手友好度
30/100
Issue 類型
缺陷
描述清晰度
需要釐清
活躍度
停滯
技術堆疊
go
領域
cloud

研究方向

首先使用提供的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

環境準備

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

cloudinary/cloudinary-go 的其他 Issue

查看 cloudinary/cloudinary-go 的全部 Issue

相似的 Issue

更多 Go Issue

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。