We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
`
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
The text was updated successfully, but these errors were encountered:
Hi @bete7512 ,
Thanks for contacting Cloudinary.
I used the below code to upload and it worked fine. Can you please let us know what error are you facing?
func credentials() (*cloudinary.Cloudinary, context.Context) { // Add your Cloudinary credentials, set configuration parameter // Secure=true to return "https" URLs, and create a context //=================== cld, _ := cloudinary.NewFromParams("", "", "") cld.Config.URL.Secure = true ctx := context.Background() return cld, ctx }
func uploadBase64Image(cld *cloudinary.Cloudinary, ctx context.Context) { resp, err := cld.Upload.Upload(ctx, "data:image/png;base64,", uploader.UploadParams{}) if err != nil { fmt.Println("error") } // Log the delivery URL fmt.Println("2. Upload an image\nDelivery URL:", resp.SecureURL) }
Thanks, Sree
Sorry, something went wrong.
Can u please assign this to me?
No branches or pull requests
`
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)
}
`
I tried to do like this and also I tried many but just not working
The text was updated successfully, but these errors were encountered: