게시판 본문 ASP, ASP.NET, IIS & Script - Read Only

안녕하세요..질문좀할께영^^
작성자: 무관
작성일시: 2006-03-30 00:49,  조회수: 1,220
파일 2개를 업로드 하는건데요 중복된 파일이 있다면 license(1).txt/webma(2).ini 이런식으로 폴더에는 잘들어가는데요 디비에 입력은 license.txt 이렇게 되서 문제 거든요 디비에도 license(1)이렇게 들어가야하는데 말입니다..어떻게 고쳐야 할지
도저히 모르겟네요 ㅠㅠ


'############# 1첫번째 파일업로드 ######################

Set theField1 = theForm(trim("file1"))(1)
If theField1.FileExists Then

'여기서부터 업로드 시작합니다.
strFileName1 = thefield1.SafeFileName
FileSize = thefield1.Length
'여기서 사이즈 제한합니다.
if thefield1.Length > 1024000*2 then
Response.Write "<script language=javascript>"
Response.Write "alert(""2M이상은 업로드하실수 없습니다."");"
Response.Write "history.back();"
Response.Write "</script>"
response.end
else
strFileWholePath = GetUniqueName(strFileName, Path)
theField1.Save strFileWholePath

strFileName1= theField1.RawFileName
End If
end if
'############# 2두번째 파일업로드 ######################

Set theField2 = theForm(trim("file2"))(1)
If theField2.FileExists Then

'여기서부터 업로드 시작합니다.
strFileName2 = thefield2.SafeFileName
FileSize = thefield2.Length
'여기서 사이즈 제한합니다.
if thefield2.Length > 1024000*2 then
Response.Write "<script language=javascript>"
Response.Write "alert(""2M이상은 업로드하실수 없습니다."");"
Response.Write "history.back();"
Response.Write "</script>"
response.end
else
strFileWholePath = GetUniqueName(strFileName, Path)
theField2.Save strFileWholePath

strFileName2= theField2.RawFileName
End If
end if

'############# 파일업로드 끝(END) ######################



Function GetUniqueName(byRef strFileName, Path)

Dim strName, strExt
' 확장자를 제외한 파일명을 얻는다.
strName = Mid(strFileName1, 1, InstrRev(strFileName1, ".") - 1)
strExt =Mid(strFileName1, InstrRev(strFileName1, ".") + 1) '확장자를 얻는다


Dim fso
Set fso = Server.CreateObject("Scripting.FileSystemObject")

Dim bExist : bExist = True
'우선 같은이름의 파일이 존재한다고 가정
Dim strFileWholePath : strFileWholePath = Path & "\" & strName & "." & strExt
'저장할 파일의 완전한 이름(완전한 물리적인 경로) 구성
Dim countFileName : countFileName = 0
'파일이 존재할 경우, 이름 뒤에 붙일 숫자를 세팅함.

Do While bExist ' 우선 있다고 생각함.
If (fso.FileExists(strFileWholePath)) Then ' 같은 이름의 파일이 있을 때
countFileName = countFileName + 1 '파일명에 숫자를 붙인 새로운 파일 이름 생성
strFileName = strName & "(" & countFileName & ")." & strExt
strFileWholePath = Path & "\" & strFileName
Else
bExist = False
End If
Loop
GetUniqueName = strFileWholePath
End Function

wdate=date()
sql= "select max(num) from BBS"
set rs=server.createobject("adodb.recordset")
rs.open sql,db

if isnull(rs(0)) then
num=1
ref=1
else
num=rs(0)+1
ref=rs(0)+1
end if

ref_level = "0"
ref_step = "0"

sql= "insert into BBS values"
sql=sql & "("
sql=sql & "'"&num&"',"
sql=sql & "'"&strFileName1&"',"
sql=sql & "'"&strFileName2&"',"

IP 주소: 222.112.2.218
전체 2,095 건의 게시물, 84 페이지로 구성된 ASP, ASP.NET, IIS & Script 게시판의 27 페이지입니다.
게시물
1,485

큐브질문입니다

디폐인

2006-04-22 1,222
1,484

re: 큐브질문입니다

송원석

2006-04-22 3,299
1,483

File Cube 에대해서

김용식

2006-04-18 1,156
1,482

re: File Cube 에대해서

송원석

2006-04-18 3,139
1,480

질문있어요(소스첨부)

12

2006-04-14 1,286
1,479

re: 질문있어요(소스첨부) [2]

송원석

2006-04-15 3,244
1,478

사용자 또는 관리자에 의해 삭제된 글입니다.

Anonymous

2006-04-13 0
1,477

re: 포트포워딩과 업로드 , 다운로드와의 관계

송원석

2006-04-10 3,171
1,476

re: 포트포워딩과 업로드 , 다운로드와의 관계

O_Oa

2006-04-12 1,191
1,475

re: 포트포워딩과 업로드 , 다운로드와의 관계

송원석

2006-04-12 3,192
1,474

re: 다운로드는 해결했는데..

O_Oa

2006-04-13 1,164
1,473

re: 다운로드는 해결했는데.. [1]

송원석

2006-04-13 3,153
1,472

몇가지 질문좀..

입문자.

2006-04-05 3,070
1,471

re: 몇가지 질문좀..

송원석

2006-04-05 3,205
1,470

re: 몇가지 질문좀..

입문자.

2006-04-06 3,040
1,469

re: 몇가지 질문좀..

송원석

2006-04-06 4,250
1,468

파일사이즈제한

무관

2006-04-04 9,264
1,467

re: 파일사이즈제한

송원석

2006-04-04 3,584
1,466

영타를 한글로 변환 하는 ASP 페이지

초보자

2006-04-01 3,571
1,465

re: 영타를 한글로 변환 하는 ASP 페이지

송원석

2006-04-01 3,464
1,464

windows script componets??

초짜

2006-04-01 3,174
1,463

re: windows script componets?? [1]

송원석

2006-04-01 3,201
1,462

re: windows script componets?? [1]

초짜

2006-04-04 1,173

안녕하세요..질문좀할께영^^

무관

2006-03-30 1,220
1,460

re: 안녕하세요..질문좀할께영^^

송원석

2006-03-30 3,322