Created
February 14, 2011 10:25
-
-
Save luniki/825696 to your computer and use it in GitHub Desktop.
StudipDocument.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
static function createWithFile($file) | |
{ | |
$doc = new StudipDocument(); | |
if (is_uploaded_file($file)) { | |
// create new ID | |
$this->setId($this->getNewId()); | |
$newpath = get_upload_file_path($this->getId()); | |
// try moving uploaded file | |
$status = @move_uploaded_file($file, $newpath); | |
if (!$status) { | |
throw new Exception(_("Dateiübertragung gescheitert!")); | |
} | |
} | |
return $doc; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment