File uploads fixes.

This commit is contained in:
nikolark committed 2012-02-20 00:17:48 +01:00
1 parent 462bad096a
commit f58ae1bc8a
4 files changed
+22 -14

No files matched your search

+4 -3
View File
@@ -80,7 +80,8 @@ class Concert {
if( $_FILES['userfile']['error'] != 4 ) {
$temp_name = new_file($_FILES['userfile'], "program");
rename_file($temp_name, $this->id, "program");
$this->picture = $this->id.substr($temp_name, -4);
$ext = strtolower( pathinfo($temp_name, PATHINFO_EXTENSION) );
$this->picture = $this->id . "." . $ext;
}
$this->links = $data['links'];
@@ -142,8 +143,8 @@ class Concert {
$this->id = getNextId("program");
if($_FILES['userfile']['error'] != 4){
$temp_name = new_file($_FILES['userfile'], "program");
rename_file($temp_name, $this->id, "program");
$ext = strtolower( pathinfo($temp_name, PATHINFO_EXTENSION) );
rename_file($temp_name, $this->id, "program");
$ext = strtolower( pathinfo($temp_name, PATHINFO_EXTENSION) );
$this->picture = $this->id . "." . $ext;
} else {
$this->picture = "0";