[Solved] File after using php’s unlink function [closed]


Will the file be deleted permanently or is it still somewhere in the server?

The file will be deleted. If the server’s OS and/or file system has a mechanism to recover deleted files, then it may be recoverable by that mechanism. If the file system doesn’t over-write the location of the file on the storage medium (which is very likely) then the physical data is still on the disk and could potentially be recovered prior to that space being reclaimed by another file.

Will the file be removed securely or PHP just like other operating systems unlinks the file from your HDD?

The file will be deleted. However your OS and/or file system handles deletes, that mechanism will be invoked.

Where does the file go after using this function.

The file will be deleted. If deleting a file in your OS and/or file system results in moving that file somewhere, it may end up in that location. If not, it won’t.


In short… It deletes the file. It doesn’t copy the file, move the file, replace the file, etc. It deletes the file. In most file systems this means removing the entry in the file system’s index corresponding to that file. The location on the disk which stores the actual data of the file is unchanged, but the file system now interprets that location as “free space” and may write to it at any time.

solved File after using php’s unlink function [closed]