About $ _ FILES

Source: Internet
Author: User
The $ _ FILES problem is completely normal code on a computer. after changing the computer, something went wrong. what is the problem? The webpage is garbled and the function cannot be used. & lt; html & gt; & nbsp; & lt; head & gt; & nbsp; & lt; meta & nbsp; http-equiv = "C about $ _ FILES
The code on a computer is completely normal. if something goes wrong after changing the computer, what is the possible problem? Thank you!
The page is garbled and the function cannot be used.

 

 



File Upload

 

 



 



Function getname ($ exname ){

$ Dir = "uploadfile /";

$ I = 1;

If (! Is_dir ($ dir )){

Mkdir ($ dir, 0777 );

}


While (true ){

If (! Is_file ($ dir. $ I. ".". $ exname )){

$ Name = $ I. ".". $ exname;

Break;

}

$ I ++;

}


Return $ dir. $ name;

}


$ Exname = strtolower (substr ($ _ FILES ['upfile'] ['name'], (strrpos ($ _ FILES ['upfile'] ['name'], '. ') + 1 )));

$ Uploadfile = getname ($ exname );


If (move_uploaded_file ($ _ FILES ['upfile'] ['tmp _ name'], $ uploadfile )){

Echo "file uploaded successfully! ";
Echo" ";
Echo"
Below are some information about file upload:


Original file name: ". $ _ FILES ['upfile'] ['name'].

"
Type: ". $ _ FILES ['upfile'] ['type'].

"
Temporary File name: ". $ _ FILES ['upfile'] ['tmp _ name'].

"
File size: ". $ _ FILES ['upfile'] ['size'];
}


?>

 
Script

Share :??

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.