This article mainly introduces how js achieves face picture cutting and scaling and allows you to upload images without refreshing images. It involves javascript, php, and other related techniques, and provides some reference value, for more information about how to use JavaScript to cut and scale avatar images and upload images without refreshing images, see the following example. Share it with you for your reference. The details are as follows:
Fname: the name used for receiving data in the background. This parameter is required.
Funstr: indicates the function used to start uploading and execution. No function is used by default.
Funbak: the callback function after the upload is successful. required.
Furl: the upload address. The submission page of the current form is used by default.
Note: The upload address and current address must be an agreed domain name. Otherwise, the callback function cannot obtain the address sent back after the upload.
A. php:
Export path='a.jpg '; move_uploaded_file ($ _ FILES ['uimg'] ['tmp _ name'], $ path); exit (json_encode (array ('ztai' => true, 'url' => $ path )));