Resize image on server

后端 未结 3 1313
执笔经年
执笔经年 2020-12-20 10:10

I made a file that is in charge of uploading images, this images are then moved to a folder in the server. I think I can\'t resize the image directly in the $_FILES array so

3条回答
  •  遥遥无期
    2020-12-20 10:57

    Move the uploaded file to a tmp directory (use tmp_name in $_FILES for original location), read it in using gd, resize then save it to the final directory.

    http://php.net/manual/en/function.move-uploaded-file.php http://us3.php.net/manual/en/function.imagecreate.php http://us3.php.net/manual/en/function.imagecopyresized.php

提交回复
热议问题