I'm trying to work out the safest way to confirm some details about an uploaded file - e.g. file extension, file size (bytes), file dimensions (if image), etc.  I've found several methods to get the extension but they all seem to be based on manipulating the file name, which is very trivial to fake.  For image dimensions I've been using getimagesize(). For file size I've been using filesize.  I'm working with sensitive data, so want to have every point of entry to the site secure. Is there a safer way to get all of this data on an uploaded file?  Thanks in advance for any help.
Ok, so I have an index.php file which has to process many different file types.  how do I guess the filetype based on the REQUEST_URI.  If I request http://site/image.jpg, and all requests redirect through index.php, which looks like this  &lt;?php    include('/www/site'.$_SERVER['REQUEST_URI']); ?&gt;   How would I make that work correctly?  Should I test based on the extension of the file requested, or is there a way to get the filetype?
What is the difference between a framework and a library?   I always thought of a library as a set of objects and functions that focuses on solving a particular problem or a specific area of application development (i.e. database access); and a framework on the other hand as a collection of libraries centered on a particular methodology (i.e. MVC) and which covers all areas of application development. When a user votes to close a question (for whatever reason), it would helpful to receive a notification (in the inbox) when the question is edited (either the text, tags, if it closes then is re-opened) so that the user can then modify his or her vote if the question is properly adjusted. I cancelled the Microsoft Windows 10 Reservation and uninstalled KB3035583, but Windows 10 is still trying to install.   After I uninstalled KB3035583 and restarted my laptop as instructed, I could not find KB3035583 to hide it.   Now Windows 10 is sitting in my Windows Update saying that it will install when I restart my computer. How are the number of views in a question calculated? I saw it's not just a page views number, because, if I press F5 several times, it won't increase the number of views.  They could store my IP address in a table, but wouldn't that make it slow? They would need to query a database one more time for each request. If $\left|z+\frac{2}{z}\right |=2$, then prove that max value of $|z|$ is $\sqrt 3 + 1$ (Corrected version) Then the expression will be  $$|z|+\frac{2}{|z|}\ge 2$$  Solving the quadratic inequality   $$|z|\ge1+i$$ and $$|z|\le1-i$$  I don’t know how to solve further. Please help  Thanks!   this is the corrected version of an identical question asked by me. I am sorry for the inconvenience caused Evaluating logistic regression and interpretation of Hosmer-Lemeshow Goodness of Fit I have downloaded and installed the newest  for my Windows 7 (64-bit OS), but when I want to install 64-bit Linux, the New->Create Virtual Machine only displays 32-bit option, no 64-bit option. Could anyone give any clues about this issue? Thanks very much in advance! It has been some months since I've turned on my Playstation 3. Today, when I turned it on with my controllers, it didn't work. I thought "Hey, the battery surely ran out", so I tried to charge them but they don't seem to be charging at all. Could it be that they're officially weight papers by now? I  just got these 10 e-mails 5 hours ago from do-not-reply@stackexchange.com:      Recently, you asked a question on [X] Stack Exchange, but you haven't verified your email address yet.      Click on the following link to verify your email and set a password so that you can log in.      Here, [X] refers to all of the following:    GameDevelopment.SE SharePoint.SE Unix.SE  Skeptics.SE Japaneese.SE HomeImprovement.SE SciFi.SE PersonalFinanceMoney.SE  DatabaseAdmins.SE  TeX.SE    I haven't posted on any of these except for TeX.SE, but that was not recently, and through my real account.   =   I asked about this , and was told that someone seems to be impersonating me by using my email. Is it possible for staff to stop this?   Also, I'm pretty surprised there is no measure to stop people from using emails to existing SE accounts (see for example, on wordpress.com, if you use an e-mail which has an existing account on wp.com, you are asked to log in.).    EDIT:  I just got 2 more emails an hour ago for SharePoint.SE, and for AmateurRadio.SE. I'm trying to connect to another computer in my house via ssh. Both computers have ubuntu and openssh installed. When I run the command "ssh username@ip" on terminal I'm asked for the user's password I'm trying to connect to. I type it but I get this error "Permission denied, please try again." I'm sure the password is correct, then why can't I access? Is a contradiction enough to prove a set equality to $\varnothing$? How can I get this 'Version: 0.1.0 - 94" value from the  tag in selenium webdriver? How can I get this Version: 0.1.0 - 94 value from the &lt;div&gt; tag in selenium webdriver? and here is my code:  &lt;div _ngcontent-qbk-c3="" style="text-align: center;"&gt;Version: 0.1.0 - 94&lt;/div&gt; Last year I hired someone to do some work for our website but accidentally lost the PSD files since then. It's a fairly basic concept but I am fairly inexperienced with using masks.  How can I create the black circular gradient area as shown in this image below? I need to get as close as possible where it matches existing images on the site, why I am hoping its not too hard.  Thank you! Is the "Roman alphabet" what we use for English? I understand that the alphabet for the English language is not strictly English as languages such as French, Dutch and many more use the same alphabet, with few additions in other languages. Is Roman alphabet the common term to refer to this set of symbols for writing texts? Converting string to tuple and adding to tuple Where are the proprietary NVIDIA drivers in 16.04? The proprietary NVIDIA drivers "disappeared" with my latest update:    The option of "Proprietary drivers for devices" is correctly set under the "Ubuntu Software" tab. I have the graphics-driver PPA (ppa:graphics-drivers/ppa) correctly added to my sources.  Any ideas on how to bring the proprietary drivers back?  PS1: I need them because some of the games I play under wine don't work without them, for whatever reason.  PS2: Also, this feels like it should have a straightforward answer, but I've been looking online for a while without luck. ISP blocking port 25 I would like to use Zapf's Palatino font for the text in my document, which also includes a lot of maths. And I would like a good font for the maths. This is a snapshot of what I am doing.  \documentclass[10pt,letterpaper]{memoir} \usepackage{amsmath} \usepackage{amssymb} \usepackage{mathpple} \usepackage{upgreek} \usepackage{mathpazo} \usepackage{lipsum}  \begin{document}  \chapter{Demo}  Some regular text. \lipsum[1]  Now for some maths.  \begin{displaymath} P_{N-1 + m} = \frac{C}{N-{1} + m} \binom{N_{2} - N_{1}}{m}         \alpha^{m}\beta^{(N_{2} - N_{1}) -m} \end{displaymath}  The number 27 is the sum of the first 5 odd prime numbers: $27 = 1+3+5+7+11$  \end{document}   To me the text and math fonts seem a good fit but the text does not look like Palatino. I am studying elementary Algebraic Topology recently. I have seen that a topological space is identified with a group. We are telling the group as Fundamental Group. So every topological space $X$ and for any $x \epsilon X$ there is a fundamental group $\pi_1 (X,x)$. I have a question about the converse. If we consider any arbitrary group $G$, then does there exist a topological space $X$ and an element $x\epsilon X$ such that $\pi_1 (X,x)=G$? Find the last two digits of $9^{{9}^{9}}$ I have to find the last two decimal digits of the number $9^{{9}^{9}}$.  That's what I did:  $$m=100 , \phi(m)=40, a=9$$ $$(100,9)=1, \text{ so from Euler's theorem,we have :} 9^{40} \equiv 1 \pmod{100}$$  $$9^{{9}^{9}} \equiv 9^{9^{2+2+2+2+1}} \equiv 9^{9^2 \cdot 9^2 \cdot 9^2 \cdot 9^2 \cdot 9} \equiv 9^{81 \cdot 81 \cdot 81 \cdot 81 \cdot 9} \equiv 9^{(40+40+1) \cdot (40+40+1) \cdot (40+40+1) \cdot (40+40+1) \cdot 9} \equiv (9^{(40+40+1)})^{(40+40+1) \cdot (40+40+1) \cdot (40+40+1) \cdot 9} \equiv 9^9 \equiv 9^4 \cdot 9^4 \cdot 9 \equiv 6561 \cdot 6561 \cdot 9 \equiv 3721 \cdot 9 \\ \equiv 21 \cdot 9 \equiv 89 \pmod{100}$$  So,the last two digits are $8 \text{ and } 9$. $$$$But,is there also an other way two calculate the last two digits of $9^{{9}^{9}}$ or is the above the only one?