In meiner PHP-App funktioniert copy()
Funktion gut, aber funktioniert nicht im Server.copy() - Funktion gibt true zurück, aber die Datei wird nicht in PHP aktualisiert
$new_file = 'some_new_file';
$old_file = 'existing_file';
if (copy($new_file, $old_file)) {
return new JsonResponse(array('status' => true,'success' => 'File saved successfully'));
//print_r("Copy success!");
}else{
return new JsonResponse(array('status' => false,'success' => 'Problem in saving file'));
}
Es kehrt Status als true
, aber $old_file
wird nicht aktualisiert.
In diese auch kopieren() gibt true zurück, da die Antwort, was ich ist
{"status":true,"success":"File saved successfully"}
$ old_file wird eine Zieldatei und new_file ist eine andere Datei und ich muss den Inhalt von $ new_file nach $ old_file kopieren. – Swathi