Skip to content

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

@tanmayag8958

Description

@tanmayag8958

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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions