티스토리 뷰
업로드
$upfile_path = "./upfile"; // 업로드파일 위치
$upfile_idx = date('Ymdhis').rand(1,9); // 업로드파일명
if(!is_dir($upfile_path)){ // 업로드 디렉토리 생성
echo exec("mkdir $upfile_path");
exec("chmod 707 $upfile_path");
}
if($upfile_size > 0){
$upfile_tmp = $upfile_idx.".".substr($upfile_name,-3);
exec("cp $upfile $upfile_path/$upfile_tmp");
exec("chmod 606 $upfile_path/$upfile_tmp");
if($row->upfile != "") exec("rm -f $upfile_path/*$row->upfile");
$upfile_sql = " , upfile='$upfile_tmp', upfile_name='$upfile_name' ";
}
다운로드
$file = "./upfile/".$upfile;
$filename = $upfile_name;
if(file_exists($file))
{
if( strstr($HTTP_USER_AGENT,"MSIE 5.5")){
header("Content-Type: doesn/matter");
header("Content-Disposition: filename=$filename");
header("Content-Transfer-Encoding: binary");
header("Pragma: no-cache");
header("Expires: 0");
}else{
header("Content-type: application/x-unkown");
Header("Cache-Control: cache, must-revalidate");
header("Content-Disposition: attachment; filename=$filename");
header("Content-Transfer-Encoding: binary");
header("Pragma: no-cache");
header("Expires: 0");
}
if(is_file("$file")){
$fp = fopen("$file","r");
if(!fpassthru($fp)) {
fclose($fp);
}
}
}else{
echo "<script>alert('첨부파일이 존재하지 않습니다.');history.go(-1);</script>";
}
파일삭제
include "../../dbcon.php";
include "lib.php";
$upfile_path = "./upfile"; // 업로드파일 위치
$dQuery = "select * from EduList where no='$no'";
$dResult = mysql_query($dQuery);
$dArray = mysql_fetch_array($dResult);
$upfile_name = $dArray[upfile];
if($upfile_name != "") exec("rm -f $upfile_path/*$upfile_name");
$dQuery = "update EduList set upfile_name='' where no='$no'";
mysql_query($dQuery);
삭제후 이동하기
- Total
- Today
- Yesterday
- gmlduqrhdwn
- judyOh blog
- naplez.net [ SCJP 1.4 ]
- DB
- web
- 한글 Mozilla 포럼 [실전웹표준가이드]
- (블로그)웹표준연구소 [마루아라소프트]
- 웹 프로그램 및 디자인관련 강좌 사이트
- (블로그)검색엔진 최적화 | 검색엔진 마케팅
- DB 툴 [DB에 대한 정보]
- PHP( 객체 지향 언어로써의 PHP )
- w3c표준규격 번역
- 서버 주무르기
- 검색엔진 마스터
- apache-kr.org
- 한국 썬 개발자 네트워크
- 검색엔진 최적화 블로그
- 피라시스닷컴(SVN관련)
- 웹기반 DNS 서비스 DNSEver.com
- JEUS / Tmax / WebtoB
- 웹기반 무료 DNS서버
- JAVA 강좌
- 少年易老學難成, 一寸光陰不可輕. 未覺池塘春草夢, 階前梧…
- MyJavaServer ( JSP 무료 호스팅 )
- I GOT IT (IT`S CRADLE & INCUBA…
- Todayis(HS)
- oracleclub.com
- Prototype (JavaScript Framewor…
- JSPWiki (openframework.or.kr)
- 제갈장비(JAVA_BLOG)
- jakartaproject
- Oracle_download
- jQuery plugin
- Test
- 안드로이드 앱 개발
- 행복한 개발자입니다.
- Flex & etc
- Flex & Design
- (iBatis)참고
- FLEX참고 사이트
- 대용량파일에 대한 watchservice 참고
- win7 update pack
- 롤링
- 자동증가
- SEO
- DOM
- php
- CSS
- sw기술자 경력관리
- iBatis
- 구글
- ASP
- mysql
- 다운로드
- Linux
- 뚜비
- vi
- 오라클
- excel
- find
- Eclipse
- 비교문
- flex
- 시퀀스생성
- 정보보호전문자격
- java
- 머먹구사냐
- derby
- mybatipse #egovframework3.8
- GD
- apache
- Ajax
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | ||
6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 | 29 | 30 | 31 |