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
Post a Comment