Files
distribution_erp/WebContent/SE2/sample/photo_uploader/file_uploader_html5.php
T
chpark 082042cd6d FITO PLM 프로젝트 설정 및 소스 교체
- DB 연결: 211.115.91.141:11140/fito, postgres/intops0909!!
- 도메인: fito.wace.me
- 소스 교체 (woosung 기반)
- Dockerfile.dev 컴파일 단계 추가
- 로그인 페이지 DH Autoware 스타일 리디자인
- Constants: 회사명 (주)피토/fito, SYSTEM_TITLE FITO PLM
- 헤더 로고 FITO 로고로 변경
- 파비콘 추가
- 관리자 팝업 window.open 공백 이슈 수정

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-16 18:44:57 +09:00

38 lines
966 B
PHP

<?php
$sFileInfo = '';
$headers = array();
foreach($_SERVER as $k => $v) {
if(substr($k, 0, 9) == "HTTP_FILE") {
$k = substr(strtolower($k), 5);
$headers[$k] = $v;
}
}
$file = new stdClass;
$file->name = str_replace("\0", "", rawurldecode($headers['file_name']));
$file->size = $headers['file_size'];
$file->content = file_get_contents("php://input");
$filename_ext = strtolower(array_pop(explode('.',$file->name)));
$allow_file = array("jpg", "png", "bmp", "gif");
if(!in_array($filename_ext, $allow_file)) {
echo "NOTALLOW_".$file->name;
} else {
$uploadDir = '../../upload/';
if(!is_dir($uploadDir)){
mkdir($uploadDir, 0777);
}
$newPath = $uploadDir.iconv("utf-8", "cp949", $file->name);
if(file_put_contents($newPath, $file->content)) {
$sFileInfo .= "&bNewLine=true";
$sFileInfo .= "&sFileName=".$file->name;
$sFileInfo .= "&sFileURL=upload/".$file->name;
}
echo $sFileInfo;
}
?>