Is it possible to get filename from the byte array or stream?
I wont to save the file. I just want to retrieve its name.
Is it possible to get filename from the byte array or stream? I wont
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
If the
Streamis actually aFileStream, then this may be available by casting toFileStreamand accessing the.Nameproperty:However, in the general case: no, this is not available. A
byte[]certainly has no concept of a filename, nor do most other types of streams. Likewise, aFileStreambase-stream that is being wrapped by other streams (compression, encryption, buffering, etc) will not expose such information, despite the underlying stream (several layers down) being a file.I would handle the filename separately.