file upload - Is this a legit way to convert images to jpg while uploading them via php? -


i'm working on project right now, users can upload profile pictures server via php.

the file automatically renamed according session-id. want convert uploaded pictures automatically jpgs.

thought i'd try manipulate file-extension "jpg" while uploads, never thought work. seems does, file uploaded server jpg (tried chrome).

is legit way convert images or there problems in other browsers?

[...]    if ($uploadok != 0) {          $filetypetest = "jpg";          $newfilename = $sessionid . '.' .$filetypetest;          move_uploaded_file($_files["bild"]["tmp_name"], "uploads/" . $newfilename);     } 

changing file extension doesn't convert it, it'll still whatever file type uploaded as. browser able display information file's mime type, not extension.


Comments

Popular posts from this blog

javascript - gulp-nodemon - nodejs restart after file change - Error: listen EADDRINUSE events.js:85 -

Fatal Python error: Py_Initialize: unable to load the file system codec. ImportError: No module named 'encodings' -

javascript - oscilloscope of speaker input stops rendering after a few seconds -