Skip to content
New issue

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

Unable to update the FileType using files.remote.update #1355

Open
tanmayag8958 opened this issue Nov 27, 2024 · 0 comments
Open

Unable to update the FileType using files.remote.update #1355

tanmayag8958 opened this issue Nov 27, 2024 · 0 comments

Comments

@tanmayag8958
Copy link

tanmayag8958 commented Nov 27, 2024

What happened

Unable to update fileType using files.remote.update

Expected behavior

FileType should be changed from gif to png

Steps to reproduce

In my usecase i have uploaded a gif file and then i am updating it with png file using files.remote.update API but the png image is showing as blurred after update and after downloading it is coming as gif.

reproducible code

	uploads := slack.UploadFileV2Parameters{
		Filetype:        "auto",
		Filename:        "Loading...",
		FileSize:        int(fileSize),
		Reader:          fileBuffer,
		Channels:        []string{n.BotEvent.ChannelID},
		Channel:         n.BotEvent.ChannelID,
		ThreadTimestamp: n.BotEvent.ThreadTimeStamp,
		Title:           appMentionTmpl.Title,
		//InitialComment:  appMentionTmpl.InitialComment,
	}

	uploadResp, er := n.Messenger.CompleteUploadExternal(ctx, uploads)

        payload := slack.RemoteFileParameters{
                Filetype: 	    "png",
		ExternalID:         uuid.New().String(),
		Title:              appMentionTmpl.Title,
		PreviewImage:       text,
		PreviewImageReader: nlsObject.Reader,
	}
	_, err = n.Messenger.UpdateRemoteFile(ctx, n.FileID, payload)

Versions

  • Go: v1.22.6
  • slack-go/slack: v0.14.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant