CC-3192: Problem with web uploads for Airtime 2.0.0 beta2

- The bug was introduced with CC-3086. When file is large enough so
the pluload use chucking, it would create different temp name for each
chuck.
- Fixed it by using unique_name feature on plupload
This commit is contained in:
James 2011-12-14 15:58:26 -05:00
parent 6d9e9f3459
commit 7c81fa29eb
2 changed files with 4 additions and 7 deletions

View file

@ -810,12 +810,9 @@ class Application_Model_StoredFile {
$contentType = $_SERVER["CONTENT_TYPE"];
// create temp file name (CC-3086)
$command = "mktemp --tmpdir=".$p_targetDir;
$tempFilePath= exec($command);
if($tempFilePath == ""){
die('{"jsonrpc" : "2.0", "error" : {"code": 101, "message": "Unable to create tmp file."}, "id" : "id"}');
}
// we are not using mktemp command anymore.
// plupload support unique_name feature.
$tempFilePath= $p_targetDir . DIRECTORY_SEPARATOR . $fileName;
if (strpos($contentType, "multipart") !== false) {
if (isset($_FILES['file']['tmp_name']) && is_uploaded_file($_FILES['file']['tmp_name'])) {