2

I'am reading a file through sockets, Is there a way that I can extract a file name, extension?

byte[] fileBytes; // filled byte[] array, how to extract info about file?
1

1 Answer 1

3

You can't get a filename from a binary data received from stream or socket, unless you know something about these bytes, for example

First ten bytes represent filename in ASCII encoding.

If you have no such guarantees, no chance.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.