$json _result [' status '] = 0; $path = '. /upfile '; $json _result [' status '] = 0; $json _result [' successmsg '] = ' upload failed ', if (Isset ($_files [' image ')]) { $upfile = ' upfile/ ‘ . $_files [' Image '] [' name ']; if (! @file_exists ($path)) { @mkdir ($path); } $result = @move_uploaded_file ($_files [' Image '] [' tmp_name '], $upfile); if (! $result) { $json _result [' status '] = 0; $json _result [' successmsg '] = ' upload failed '; $json _result [' datas '] = Array (' Savepath ' = $upfile); Exit (Json_encode ($json _result));} } $json _result [' successmsg '] = ' upload succeeded '; $json _result [' status '] = 1; $json _result [' datas '] = Array (' Savepath ' = ". $_server[' server_name '].": ". $_server[' Server_port ']." /mafeng/". $upfile);p Rint_r (Json_encode ($json _result));
PHP-The pain of uploading pictures (build folder)