Home  >  Article  >  Backend Development  >  Upload pictures without refreshing

Upload pictures without refreshing

WBOY
WBOYOriginal
2016-07-25 08:44:02961browse
php no refresh accept files
                 
On Fulload_pic ($ PATH) {
$ FILENAME = 'Userfile';
$ pic_path = ''; size = $_FILES [$ filename]['size'];
    if ($picname != "") {
  1.             $type = strstr($picname,'.'); .gif'&&$type!='.png')
  2.                                                                                                 => 'Format error, please upload jpg, gif, png',
  3.                                                              ,
  4.                                                              'pic_path' => ''
  5.                                                                                               $pics = md5(uniqid()).$type;
  6. $path = $this->create_dir($path);
  7.                                 $pic_path                                                                                                                                                                                              '], $pic_path);
  8. } }
  9.                                                                                                                          = round($picsize/1024,2);
  10.       $ arr = array(
  11.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         . son_encode( $arr);
  12.            }
  13. Copy code
  14. Upload pictures
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn