acid
RSS FEED
Home
Tag
MediaLog
LocationLog
Guestbook
Admin
Write
sidebar open
sidebar close
에시드
쌈마이코더
달력
이전
다음
2025.4
일
월
화
수
목
금
토
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
Total
Today
Yesterday
카테고리
미분류
(104)
source code
(3)
tistory TIP
(1)
project
(4)
image
(1)
BIG
(0)
small
(0)
medium
(0)
DB
(25)
RFC
(1)
OS
(7)
HPUX
(0)
AIX
(0)
Solaris
(0)
MAC
(1)
JAVA
(15)
C
(0)
linux
(2)
WEB
(2)
EJB
(3)
WAS
(2)
HTML/CSS
(2)
script
(8)
util
(3)
hardware
(16)
vehicle
(4)
공지사항
태그목록
JSTL
오라클
게시판
URIEncoding
wind schott
SQL(Oracle)
M274
드라우트 스탑
x220t
select
금호kw27
70mai pro plus a500
mysql
draught stop
a207 wind deflector
데이터베이스
개발용 마우스
Struts
정규식
perl
Performance Mouse MX
0.0.34ww
useBodyEncodingForURI
a500 펌웨어
E200 engine
javascript
a207
AWS EC2 OSX
WebParser: RegExp matching error
E200 엔진
최근에 올라온 글
최근에 달린 댓글
최근에 받은 트랙백
글 보관함
링크
acid.
'전체 글'
에 해당되는 글 104건
2009.03.11
파일업로드 관련 및 스크립트 이미지처리
2009.03.10
Syntax Highlight 1.5.1를 tistory에 적용시 수정부분
파일업로드 관련 및 스크립트 이미지처리
2009. 3. 11. 20:42
from
source code
this.processUpload(requestInfo, uploadpath, imgFileName); //파일 업로드 public void processUpload(RequestInfo requestInfo, String uploadpath, String imgFileName) throws IllegalAccessException { FileItem[] items = requestInfo.getFileItems(); FileItem fileItem = items[0]; if ( fileItem != null ) { if ( ( imgFileName != null ) && ( !imgFileName.equals("") ) ) { doFileUploadDBFileName( fileItem, String.valueOf(0), uploadpath, requestInfo, imgFileName); } } }
//파일의 확장자만 셋팅한다. public String setFileExtension(RequestInfo requestInfo, Map<String, String> vo) { FileItem[] items = requestInfo.getFileItems(); for ( int i=0 ; i<items.length ; i++ ) { FileItem fileItem = items[i]; if ( fileItem != null ) { String fileName = fileItem.getFileName(); // add by String temp[] = fileName.split("[.]") ; String fileExtension = "." + temp[temp.length -1] ; vo.put("imgFileName", fileExtension); return fileExtension; } } return null; }
// 파일명을 upload public static void doFileUploadDBFileName(FileItem fileItem, String file_count, String uploadpath, RequestInfo requestInfo, String fileName) throws FileNotFoundException, IOException { System.out.println("================= FileUpload Start ================="); InputStream stream = fileItem.getInputStream() ; OutputStream bos = new FileOutputStream(uploadpath + fileName); System.out.println("================ File Name =================>" + uploadpath + fileName); int bytesRead = 0; byte[] buffer = new byte[8192]; while ((bytesRead = stream.read(buffer, 0, 8192)) != -1) { bos.write(buffer, 0, bytesRead); } bos.close(); stream.close(); System.out.println("================= FileUpload End ================="); }
// javaScript function imgCheck(img, location) { if (img.length > 0) { idx = img.lastIndexOf("\\"); filename = img.substring(idx+1); idx2 = filename.lastIndexOf("."); ext = filename.substring(idx2+1); ext2 = ext.toLowerCase(); if ( ext2 == "bmp" || ext2 == "jpg" || ext2 == "gif" || ext2 == "jpeg" || ext2 == "png" ) { return true; } else { alert(location + '는(은) 이미지 파일 형식이 아닙니다.\n확인해 주시기 바랍니다.'); return false; } } else { alert(location + '를 첨부해 주세요.'); return false; } }
공유하기
URL 복사
카카오톡 공유
페이스북 공유
엑스 공유
게시글 관리
구독하기
acid
'
source code
' 카테고리의 다른 글
JNDI(Java Naming and Directory Interface)
(0)
2009.03.11
[JAVA Script] 스크립트 모음집
(0)
2009.03.11
Posted by
에시드
:
Syntax Highlight 1.5.1를 tistory에 적용시 수정부분
2009. 3. 10. 02:42
from
tistory TIP
SyntaxHighlighter
syntaxhighlighter1.5.1
를
tistory
에서 사용시 style.css를 수정하지 않으면 넘버라인이 깨지는 문제가 있다.
style.css
간단히 수정할 부분을 추리면..
/* 포스트 본문 마크업 */ #content .entry { margin-bottom: 100px; } #content .entry .article ol, #content .entry .article ul, #content .entry .article il {margin:0 0 0 0; padding:0px; } .article dt {padding-top:5px; text-decoration:underline; } .article dd {padding-left:25px; padding-bottom:5px; }
#content .entry .article ol, #content .entry .article ul, #content .entry .article il {
margin:0 0; padding:0 0 0 0;
}
과감히 패딩값을 없애면 된다
skin.html
에서 다음을 추가해준다
<link type="text/css" rel="stylesheet" href="./images/SyntaxHighlighter.css"></link>
얜 암떼나 넣어두 된다
<script class="javascript" src="./images/shCore.js"></script> <script class="javascript" src="./images/shBrushCSharp.js"></script> <script class="javascript" src="./images/shBrushCpp.js"></script> <script class="javascript" src="./images/shBrushCss.js"></script> <script class="javascript" src="./images/shBrushDelphi.js"></script> <script class="javascript" src="./images/shBrushJScript.js"></script> <script class="javascript" src="./images/shBrushJava.js"></script> <script class="javascript" src="./images/shBrushPhp.js"></script> <script class="javascript" src="./images/shBrushPython.js"></script> <script class="javascript" src="./images/shBrushRuby.js"></script> <script class="javascript" src="./images/shBrushSql.js"></script> <script class="javascript" src="./images/shBrushVb.js"></script> <script class="javascript" src="./images/shBrushXml.js"></script> <script class="javascript"> dp.SyntaxHighlighter.ClipboardSwf = './images/clipboard.swf'; dp.SyntaxHighlighter.HighlightAll('code'); </script>
공유하기
게시글 관리
구독하기
acid
Posted by
에시드
:
이전
1
···
32
33
34
35
다음
티스토리툴바
닫기
단축키
내 블로그
내 블로그 - 관리자 홈 전환
Q
Q
새 글 쓰기
W
W
블로그 게시글
글 수정 (권한 있는 경우)
E
E
댓글 영역으로 이동
C
C
모든 영역
이 페이지의 URL 복사
S
S
맨 위로 이동
T
T
티스토리 홈 이동
H
H
단축키 안내
Shift
+
/
⇧
+
/
* 단축키는 한글/영문 대소문자로 이용 가능하며, 티스토리 기본 도메인에서만 동작합니다.