I'm working on a project right now, where users can upload profile pictures to the server via php.
The file is automatically renamed according to their session-id. Now I want to convert all uploaded pictures automatically to JPGs.
Thought I'd try to just manipulate the file-extension to "jpg" while it uploads, but never thought that it would actually work. But it seems like it does, the file is uploaded to the server as a JPG (tried it with Chrome).
Is this a legit way to convert images or will there be any problems in other browsers?
[...]
if ($uploadOk != 0) {
$filetypetest = "jpg";
$newfilename = $sessionid . '.' .$filetypetest;
move_uploaded_file($_FILES["bild"]["tmp_name"], "uploads/" . $newfilename);
}