Check the remote webpage to see if its ASCII or binary

Is it possible to remotely (no local / FTP access) check the url to see if the webpage (file) was loaded / generated as binary or ascii?

Thank,

Roy.

0


source to share


1 answer


Not sure about the meaning (or really the intent) of the question, but it is entirely possible to send an HTTP GET request to a web page and check what is returned. If all bytes are in the range 0x20 to 0x7e, you can safely assume it is ASCII. Anything outside this range is not ASCII.

Perhaps if your question pointed more to why you were trying to do this, we could help you further.



If you want to find out if the FTP page on the server was in ASCII or binary mode, it won't make any difference (and you won't be able to tell) if the server and machine that uploaded it as ASCII.

If you have uploaded, for example, an EBCDIC file in binary mode to an ASCII server, it will be immediately obvious :-).

+1


source







All Articles