Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • How to delete a file in Joomla?

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 388
    Comment on it

    Hello friends,

    Today we discuss how to delete a file in Joomla. In Joomla, delete() function is used to delete a file. This function perform various functionalities:

    1. deletes a file

    2. check permission of the file

    3. If the file permission is not set, it will try to change the permission and delete the file.

    Syntax:

    JFile::delete($path.$file);

    $path is the path of the file and $file is the name of the file.

    Let's take an example to understand this.

    <?php
    $path=getcwd().'/';
    $file='mydoc.txt';
    JFile::delete($path.$file);
    ?>

    In above example, $path is the path to the server and $file is the name of the file. mydoc.txt will be deleted after executing the script.

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: