Php anti-decms attachment file online management system (1/6)

Source: Internet
Author: User

Usage:
1. First create the uploadfile directory in the root directory
2. "Value" and "graph": this is used to upload the image to the parent window. Value, which is the file name and can be used for input. Graph, which is an image and used for the editor. When using this function, enter the ID value of the parent window in the text box before "value. I can assign values normally when the program is popped up at the usage layer.
3. Multiple files can be uploaded. If the target directory contains the same file, the file name will be renamed "nw..jpg", which is the same as that of "FCKeditor".
Test Environment: apache2.2.14 + PHP5.3 + windowswww.111cn.net
*/

The code is as follows: Copy code

Header ("Content-type: text/html; charset = UTF-8 ");
Define ("ROOT", str_ireplace ('/waityou /'. basename (_ FILE _), '', str_ireplace (" \ ","/",__ FILE __)));
Define ("UploadFolder", "/uploadfile/"); // upload the root directory
Define ("_ d", $ _ SERVER ['document _ root']);
Define ("AllowUploadType ", "gif | jpg | png | txt | doc | xls | ppt | pdf | rar | zip | 7z | chm | mp3 | mp4 | mpg | mpeg | flv | swf "); // supported Upload types
Define ("MaxUploadSize", @ ini_get ('upload _ max_filesize '));


$ Act = empty ($ _ GET ['act '])? '': $ _ GET ['act '];

If ($ act = ""){
Html_header ();
} Elseif ($ act = 'left '){
Left ();
} Elseif ($ act = 'right '){
If (! Empty ($ _ POST ['upfolder']) {
Upload_file (); exit;
   }

$ Dir = empty ($ _ GET ['Folder'])? '': $ _ GET ['Folder'];
If ($ dir = ''){
Right (UploadFolder );
} Else {
$ Del_file = empty ($ _ GET ['Del _ file'])? '': $ _ GET ['Del _ file'];
If ($ del_file = ''){
Open_folder ($ dir );
} Else {
Delete_file ($ del_file );
     }
   }
}

 

Home 1 2 3 4 5 6 Last page

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.