I don't know what you are trying to accomplish with this kind of answers

Your previous replay was:

that is not true..... .htm, .html, .jpg,. gif,.bmp,.png,...etc..extensions...etc....are all very important in the linux file system

And now you are saying that extensions are not important, and what's important is the file permission (The same idea I have explained in my replay just right before yours)

...sure it does..... but that is because the Ubuntu Desktop handles it all for you..... as a matter of fact, your only problem may be that you have a destop setting set to hide file extensions, like they do on Winblows

As I wrote those images uses no extensions I have deleted the extensions myself, so I am not confused with anything as you think.

And finally I have no problem with anything as you thought, I am just providing a code that might benefit someone else.

As *some* people uses file extension to determine the file type which I do not consider as a good practice.

About the permission thing: Just because you *think* your files are safe it does not mean it is, consider a web server (Apache for example) that is running scripts without suexec enabled , everybody on that server will have to grant group permission to the web server in order to let it execute those scripts.

That's just one of many examples, just keep in mind that we're humans and we're prone to mistakes & you should always expect the worst thing to happen.

Finally, by adding few more checking to your code ... You are not only protecting yourself from being cracked, You are protecting other users on the shared environment you are working on. And possibly the entire server from being rooted.

Finally I am not here to discuss Linux configurations & security issues. And I will skip answering any more replays to this node.

BTW, Thanks for the MIME types url you posted as again you proved my point, take a look yourself


In reply to Re^4: Answer: How do I find the type of an image? by ahmad
in thread How do I find the type of an image? by ahmad

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.