Mam problem z modyfikacją.
Zależy mi aby każde zdjęcie miało unikalną nazwę (ze względów bezpieczeństwa i nie tylko)
Czyli np coś takigo jako nazwa pliku
function GenerateUniqueID() { } $uniq_id=GenerateUniqueID();
Sam kod uploadu
<?php class fileDir { private $fileInfo; private $fileLocation; private $error; private $direct; function __construct($dir){ $this->direct = $_SERVER['DOCUMENT_ROOT'].$dir; } } function upload($theFile){ $this->fileInfo = $theFile; $this->fileLocation = $this->direct . $this->fileInfo['name']; return 'File was successfully uploaded'; } else { return 'File could not be uploaded'; $this->error = "Error: File could not be uploaded.\n"; $this->error .= 'Here is some more debugging info:'; } } else { return 'File by this name already exists'; } } function overwrite($theFile){ $this->fileInfo = $theFile; $this->fileLocation = $this->direct . $this->fileInfo['name']; $this->delete($this->fileInfo['name']); } return $this->upload($this->fileInfo); } function location(){ return $this->fileLocation; } function fileName(){ return $this->fileInfo['name']; } function delete($fileName){ $this->fileLocation = $this->direct.$fileName; return 'Your file was successfully deleted'; } else { return 'No such file exists: '.$this->fileLocation; } } function reportError(){ return $this->error; } } ?>