简体   繁体   中英

Get Filename from Byte Array

We can extract the mimetype from byte array, eg, by using Apache Tika.

Is it possible to get Filename from Byte Array.

不可以。您可以从内容数据本身猜测一个模仿类型,但是文件名不在其中。

The header field that you may be looking for is called Content-Disposition . If you're downloading an attachment, then there may be a file name in that field:

Content-Disposition: attachment;filename=abc.txt

But there's no guarantee that you'll have such a file name available. Also, this may only apply to HTTP and E-Mail content. From your question, it's not clear where your data's origin is...

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM