Changeset 22796 for branches/version-2_12-dev/data/class/SC_UploadFile.php
- Timestamp:
- 2013/05/02 18:11:36 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/version-2_12-dev/data/class/SC_UploadFile.php
r22567 r22796 23 23 24 24 /* アップロードファイル管理クラス */ 25 class SC_UploadFile 26 { 25 class SC_UploadFile { 27 26 var $temp_dir; 28 27 var $save_dir; … … 59 58 60 59 // ファイル管理クラス 61 function __construct($temp_dir, $save_dir) 62 { 60 function __construct($temp_dir, $save_dir) { 63 61 $this->temp_dir = rtrim($temp_dir, '/') . '/'; 64 62 $this->save_dir = rtrim($save_dir, '/') . '/'; … … 67 65 68 66 // ファイル情報追加 69 function addFile($disp_name, $keyname, $arrExt, $size, $necessary=false, $width=0, $height=0, $image=true) 70 { 67 function addFile($disp_name, $keyname, $arrExt, $size, $necessary=false, $width=0, $height=0, $image=true) { 71 68 $this->disp_name[] = $disp_name; 72 69 $this->keyname[] = $keyname; … … 79 76 } 80 77 // サムネイル画像の作成 81 function makeThumb($src_file, $width, $height, $dst_file) 82 { 78 function makeThumb($src_file, $width, $height, $dst_file) { 83 79 $objThumb = new gdthumb(); 84 80 $ret = $objThumb->Main($src_file, $width, $height, $dst_file); … … 94 90 95 91 // アップロードされたファイルを保存する。 96 function makeTempFile($keyname, $rename = IMAGE_RENAME) 97 { 92 function makeTempFile($keyname, $rename = IMAGE_RENAME) { 98 93 $objErr = new SC_CheckError_Ex(); 99 94 $cnt = 0; … … 142 137 143 138 // アップロードされたダウンロードファイルを保存する。 144 function makeTempDownFile($keyname='down_file') 145 { 139 function makeTempDownFile($keyname='down_file') { 146 140 $objErr = new SC_CheckError_Ex(); 147 141 $cnt = 0; … … 174 168 175 169 // 画像を削除する。 176 function deleteFile($keyname) 177 { 170 function deleteFile($keyname) { 178 171 $objImage = new SC_Image_Ex($this->temp_dir); 179 172 $cnt = 0; … … 192 185 193 186 // 画像を削除する。 194 function deleteKikakuFile($keyname) 195 { 187 function deleteKikakuFile($keyname) { 196 188 $objImage = new SC_Image_Ex($this->temp_dir); 197 189 $cnt = 0; … … 210 202 211 203 // 一時ファイルパスを取得する。 212 function getTempFilePath($keyname) 213 { 204 function getTempFilePath($keyname) { 214 205 $cnt = 0; 215 206 $filepath = ''; … … 226 217 227 218 // 一時ファイルを保存ディレクトリに移す 228 function moveTempFile() 229 { 219 function moveTempFile() { 230 220 $objImage = new SC_Image_Ex($this->temp_dir); 231 221 … … 248 238 249 239 // ダウンロード一時ファイルを保存ディレクトリに移す 250 function moveTempDownFile() 251 { 240 function moveTempDownFile() { 252 241 $objImage = new SC_Image_Ex($this->temp_dir); 253 242 for ($cnt = 0; $cnt < count($this->keyname); $cnt++) { … … 266 255 267 256 // HIDDEN用のファイル名配列を返す 268 function getHiddenFileList() 269 { 257 function getHiddenFileList() { 270 258 $cnt = 0; 271 259 $arrRet = array(); … … 283 271 284 272 // HIDDENで送られてきたファイル名を取得する 285 function setHiddenFileList($arrPOST) 286 { 273 function setHiddenFileList($arrPOST) { 287 274 $cnt = 0; 288 275 foreach ($this->keyname as $val) { … … 299 286 } 300 287 301 function setHiddenKikakuFileList($arrPOST) 302 { 288 function setHiddenKikakuFileList($arrPOST) { 303 289 $cnt = 0; 304 290 foreach ($this->keyname as $val) { … … 316 302 317 303 // フォームに渡す用のファイル情報配列を返す 318 function getFormFileList($temp_url, $save_url, $real_size = false) 319 { 304 function getFormFileList($temp_url, $save_url, $real_size = false) { 320 305 $arrRet = array(); 321 306 $cnt = 0; … … 356 341 357 342 // フォームに渡す用のダウンロードファイル情報を返す 358 function getFormDownFile() 359 { 343 function getFormDownFile() { 360 344 $arrRet = ''; 361 345 for ($cnt = 0; $cnt < count($this->keyname); $cnt++) { … … 368 352 return $arrRet; 369 353 } 370 function getFormKikakuDownFile() 371 { 354 function getFormKikakuDownFile() { 372 355 $arrRet = array(); 373 356 $cnt = 0; … … 384 367 385 368 // DB保存用のファイル名配列を返す 386 function getDBFileList() 387 { 369 function getDBFileList() { 388 370 $cnt = 0; 389 371 $dbFileList = array(); … … 400 382 401 383 // DBで保存されたファイル名配列をセットする 402 function setDBFileList($arrVal) 403 { 384 function setDBFileList($arrVal) { 404 385 $cnt = 0; 405 386 foreach ($this->keyname as $val) { … … 412 393 413 394 // DBで保存されたダウンロードファイル名をセットする 414 function setDBDownFile($arrVal) 415 { 395 function setDBDownFile($arrVal) { 416 396 if (isset($arrVal['down_realfilename']) && $arrVal['down_realfilename'] != '') { 417 397 $this->save_file[0] = $arrVal['down_realfilename']; … … 420 400 421 401 // DBで保存されたダウンロードファイル名をセットする(setDBDownFileと統合予定) 422 function setPostFileList($arrPost) 423 { 402 function setPostFileList($arrPost) { 424 403 for ($cnt = 0;$cnt < count($this->keyname); $cnt++) { 425 404 if (isset($arrPost['temp_down_realfilename:' . ($cnt+1)])) { … … 430 409 431 410 // 画像をセットする 432 function setDBImageList($arrVal) 433 { 411 function setDBImageList($arrVal) { 434 412 $cnt = 0; 435 413 foreach ($this->keyname as $val) { … … 442 420 443 421 // DB上のファイルの内削除要求があったファイルを削除する。 444 function deleteDBFile($arrVal) 445 { 422 function deleteDBFile($arrVal) { 446 423 $objImage = new SC_Image_Ex($this->temp_dir); 447 424 $cnt = 0; … … 457 434 458 435 // DB上のダウンロードファイルの内削除要求があったファイルを削除する。 459 function deleteDBDownFile($arrVal) 460 { 436 function deleteDBDownFile($arrVal) { 461 437 $objImage = new SC_Image_Ex($this->temp_dir); 462 438 $cnt = 0; … … 469 445 470 446 // 必須判定 471 function checkExists($keyname = '') 472 { 447 function checkExists($keyname = '') { 473 448 $cnt = 0; 474 449 $arrRet = array(); … … 492 467 493 468 // 拡大率を指定して画像保存 494 function saveResizeImage($keyname, $to_w, $to_h) 495 { 469 function saveResizeImage($keyname, $to_w, $to_h) { 496 470 $path = ''; 497 471 … … 514 488 * @return string 515 489 */ 516 function lfGetTmpImageName($rename, $keyname = '', $uploadfile = '') 517 { 490 function lfGetTmpImageName($rename, $keyname = '', $uploadfile = '') { 518 491 519 492 if ($rename === true) {
Note: See TracChangeset
for help on using the changeset viewer.
