You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
was working on "how to fix delete, replace a file", and as someone already said, using the commented lines below from getFullPath function make it work :
The point is, I couldn't rename a file either, and I think I found a tiny mistake, guess was from source too, but calling the rename function also call is_valid_path for both the old name and for the new one.
The issue comes with the new name,
realpath() returns FALSE on failure, e.g. if the file does not exist. (php manual)
, swap both calls substr and realpath the way below fixed it.
Hello,
was working on "how to fix delete, replace a file", and as someone already said, using the commented lines below from
getFullPath
function make it work :$dynPart = str_replace($_SERVER['DOCUMENT_ROOT'], '', $this->path_to_files); $full_path = $this->path_to_files . rawurldecode(str_replace ( $dynPart , '' , $path));
The point is, I couldn't rename a file either, and I think I found a tiny mistake, guess was from source too, but calling the
rename
function also callis_valid_path
for both the old name and for the new one.The issue comes with the new name,
, swap both calls
substr
andrealpath
the way below fixed it.$substrpath = substr(realpath($path) . DIRECTORY_SEPARATOR, 0, strlen($this->path_to_files)) . DIRECTORY_SEPARATOR;
by
$substrpath = realpath(substr($path . DIRECTORY_SEPARATOR, 0, strlen($this->path_to_files))) . DIRECTORY_SEPARATOR;
apparently, everything is working fine with that update..
The text was updated successfully, but these errors were encountered: