Пример #1
0
 function _AppendHttpFile($file, $path)
 {
     if (!$file["tmp_name"]) {
         throw new Exception("(2) tmp_name is not available for " . PhpUploader_GetFileName($file));
     }
     if (!PhpUploader_FileExists($file["tmp_name"])) {
         throw new Exception("(2) tmp_name is not exists " . $file["tmp_name"]);
     }
     PhpUploader_Log("_AppendHttpFile {$file} : {$path}");
     $len = filesize($file["tmp_name"]);
     $src = PhpUploader_FileOpen(__FILE__, __LINE__, $file["tmp_name"], "r");
     $data = PhpUploader_FileRead(__FILE__, __LINE__, $src, $len);
     PhpUploader_FileClose(__FILE__, __LINE__, $src);
     $dsc = PhpUploader_FileOpen(__FILE__, __LINE__, $path, "a");
     PhpUploader_FileWrite(__FILE__, __LINE__, $dsc, $data);
     PhpUploader_FileClose(__FILE__, __LINE__, $dsc);
 }
Пример #2
0
 function WriteFileData($_x137, $_x23, $_x133)
 {
     $_x145 = $_x137->Value . $_x23;
     if (is_dir($_x145)) {
         throw new Exception($_x23 . " is a folder");
     }
     if (!is_dir($_x137->Value)) {
         mkdir($_x137->Value, 0777);
     }
     $_x129 = PhpUploader_FileOpen(__FILE__, __LINE__, $_x145, "w+b");
     PhpUploader_FileWrite(__FILE__, __LINE__, $_x129, $_x133);
     PhpUploader_FileClose(__FILE__, __LINE__, $_x129);
 }