Login   Register  
Icontem

File: crazyuploader_delete_file.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Sandro Alves Peres  >  Crazy Uploader  >  crazyuploader_delete_file.php  >  Download  
File: crazyuploader_delete_file.php
Role: Auxiliary data
Content type: text/plain
Description: file
Class: Crazy Uploader
Plug-in for TinyMCE to upload document files
Author: By
Last change:
Date: 2012-09-26 11:43
Size: 1,500 bytes
 

Contents

Class file image Download
<?php
    error_reporting(0);
    header("content-type: application/json; charset=iso-8859-1");
    header("expires: Mon, 26 Jul 1997 05:00:00 GMT");
    header('last-modified: ' . gmdate('D, d M Y H:i:s') . ' GMT');     
    header("cache-control: no-cache, no-store, must-revalidate");
    header("pragma: no-cache");             
    
    if( $_POST )
    {
        include_once("crazyuploader_config.php");        
        
        $profile = "default";
        
        if( array_key_exists($_POST["profile"], $PROFILE_UPLOAD) )
        {
            $profile = $_POST["profile"];
        }         
        
        # BEGIN CODE
        # >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
        
        if( !file_exists($PROFILE_UPLOAD[ $profile ]["PATH_IMAGES"] . utf8_decode($_POST["fileName"])) )
        {
            exit('{ "deleted" : "no", "msgError" : "Ocorreu um problema ao excluir o arquivo!\\nSistema não encontrou o arquivo!" }');   
        }
        
        if( !unlink($PROFILE_UPLOAD[ $profile ]["PATH_IMAGES"] . utf8_decode($_POST["fileName"])) )
        {
            exit('{ "deleted" : "no", "msgError" : "Ocorreu um problema ao excluir o arquivo!" }');        
        }
        
        # END CODE
        # >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>        
        
        exit('{ "deleted" : "ok", "msgError" : "" }');        
    }
    else
    {
        exit('{ "deleted" : "no", "msgError" : "Ocorreu um problema ao excluir o arquivo!" }');
    }
?>