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

MediaMessage.filename() cannot get correct img name. #722

Closed
lijiarui opened this issue Aug 11, 2017 · 3 comments
Closed

MediaMessage.filename() cannot get correct img name. #722

lijiarui opened this issue Aug 11, 2017 · 3 comments

Comments

@lijiarui
Copy link
Member

Expected behavior

Get picture filename

Actual behavior

Cannot get picture filename, but can get pdf filename.

Steps to reproduce the behavior (and fixes, if any)

code as follows:

.on('message', async function (m) {
    if (m.rawObj) {
      console.log('======get filename()=======')
      const mediaMsg = new MediaMessage(m.rawObj)
      console.log(mediaMsg.filename())
    }
})

When I send a pdf file, it works as follows:

======get filename()=======
how to build a chatbot.pdf

When I send a picture, called WechatIMG1.jpg, I expect it return WechatIMG1.jpg, but it gets the following result:

======get filename()=======
813716082458353226.jpg
@binsee
Copy link
Member

binsee commented Aug 11, 2017

Video / voice / image / emoticon type msg, ( gif/jpg/png/jpeg/mp3/mp4 ).
The file name will be renamed by the server, so the file name is not required when uploading.

@binsee
Copy link
Member

binsee commented Aug 11, 2017

Other type file, (MsgType = APP =49 , AppMsgType = ATTACH =6), need file name, file name is the same when Upload and download

@lijiarui
Copy link
Member Author

ok, I see, thanks!

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

2 participants