Is it possible to upload a file with sql injection?
This site is for developers, not fraudsters I believe. And as a developer, I do not care of whatever injection variants at all. Even if this particular injection is no possible - a wide range of other injections makes you in no less danger.
The only thing a developer should know is how to properly format his query. Everything else is a useless rubbish. So, it's how to format an SQL query and how to make it properly and unconditionally is indeed what a developer ought to know.
But whatever injection types are none of his business.
The only thing a developer have to know on injections is that an improperly formatted query literal could be exploited.
in PDO I need use quote method
Nope, in PDO you need to use prepared statements instead.
is this method safe for injection?
Although the example you provided is quite safe (for the conventional encodings), the very approach is error-prone and may let you easily slip into injection. As long as formatting facility being alienable - there is still a high risk for it to be moved away from the query building and eventually be lost or improperly used.
The very benefit of a prepared statement is that it does formatting right in place, unconditionally.