Does it matter if i name my pictures "test.jpg" or just "test" for the viewers?
<img src="test.jpg" />
<img src="test" />
Both works in all browsers i know but is there any point in using the right file extension?
Summary: file extensions have many benefits that make them useful, but not necessary. File extensions contain some metadata, whilst files contain the actual contents. As a complement, you may find a rather general information about file extensions here.
Changing file extensions is usually unnecessary because files typically already have the appropriate extension. When you double-click a file that has the right extension, it will open with the correct program. For example, a file with a . TXT extension will open in a text editor, and a file with a .
htm and . html are exactly the same and will work in the same way. The choice is down to personal preference, provided you're consistent with your file naming you won't have a problem with either. Depending on the configuration of the web server, one of the file types will take precedence over the other.
The operation of changing the file extension on Windows should have no effect on the file itself. However, if you opened the file when it was a . txt (so it opened in Notepad ), and then saved it — you may have corrupted the file.
No, what matters is the Content-Type header, which gets served in the HTTP response.
It probably does not matter (see other answers).
Having that said, why NOT keeping the filename extension? It will make your page source much more readable, and you'll easily understand the file types stored at the server.
Even if there are no technical reasons for that, it is a very good practice to keep each file with a meaningful extension. Likewise, I guess you can save your .c
, .h.
and .py
files without extensions. They'll compile and run, but it would just make your life a whole lot harder.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With