Bart van Tuijl wrote:I'm in the process of building a HTML server using vb.ne
Reading through this and your other posts.
You need to come to a full stop on your code and first learn how http and the browser works.
And additionally what a 'binary' file is.
Binary file - if is an executable and you open it in notepad will always look like you found. Does not matter where it came from.
Notepad takes data and then transforms it in to characters.
That can only work if the data is in fact characters.
A binary, especially an executable will never consist solely of characters. So of course notepad will never display it because it cannot. Notepad displays a '?' for data that is not actually characters.
Some (most) executables will have data in them that you will be able to read. Doesn't mean the rest is wrong just that an executable has text in it.
And all of that depends on what character set notepad expects to see (I suspect you might want to research that also.)
You can experiment with this by using notepad to open various files on your computer. I suggest
2. Image file
3. Write your own program, put text in it (a string), compile it, then open that.
Do NOT save anything in Notepad to those above files. Unless you want to destroy them (try it if you wish but only if you expect to lose it.)
If you really want to modify a binary file manually then you need to find a 'hex editor'.
If you want to do that then you will need to learn what 'hex' means.
A browser sends a request to a web server and the web server then responds to that request.
You should learn about the HTTP protocol.
Your browser will have a 'developer tool' which allows you to inspect both requests and responses.
The HTTP protocol itself does not support file downloads in anyway.
A specific request might result in some content which originates from files being downloaded.
1. A html response (from a request) might have tags in it which the browser which will then use to make another request to the web server, and the response body with have data which is an image. The request defines this not the HTTP protocol.
Browsers used to support a 'ftp' protocol that allowed files to be downloaded. Rather than 'http' it started with 'ftp'
However apparently newer versions (Chrome, Firefox) no longer support that at all. So you would need to get an older version if you wanted to implement that protocol.