▣ ASP 덱스트업로드 이용한 파일저장 함수
함수사용예제
Dim UploadForm
Set UploadForm = Server.CreateObject("DEXT.FileUpload")
Dim Juuun : Juuun = fn_FileSave (UploadForm, ReQuest로 받아온 필드명, 파일을 저장할 경로)
아래는 함수
Function fn_FileSave (f_UploadForm___, p_FileName___, p_FileSavePath___)
Dim f_FilePath___, f_FileNameOnly___, f_FileExt___, f_FileName___
f_UploadForm___.DefaultPath = p_FileSavePath___
f_FileName___ = f_UploadForm___(p_FileName___).FileName
f_FilePath___ = f_UploadForm___.DefaultPath & "\" & f_FileNameOnly___
If f_FileName___ <> "" Then
If f_UploadForm___.FileExists(f_FilePath___) Then
If InStrRev(f_FileName___, ".") <> 0 Then
f_FileNameOnly___ = Left(f_FileName___, InStrRev(f_FileName___, ".") - 1)
f_FileExt___ = Mid(f_FileName___, InStrRev(f_FileName___, "."))
Else
f_FileNameOnly___ = f_FileName___
f_FileExt___ = ""
End If
i = 1
Do While (1)
f_FilePath___ = f_UploadForm___.DefaultPath & "\" & f_FileNameOnly___ & "[" & i & "]" & f_FileExt___
If Not f_UploadForm___.FileExists(f_FilePath___) Then
Exit Do
End If
i = i + 1
Loop
f_FileName___ = f_FileNameOnly___ & "[" & i & "]" & f_FileExt___
End If
f_UploadForm___(p_FileName___).SaveAs f_FilePath___
Else
f_FileName___ = ""
End If
fn_FileSave = f_FileName___
End Function
'Language > ASP' 카테고리의 다른 글
WindowServer에서 ASP로 메일 보내기 함수 2 (0) | 2012.04.24 |
---|---|
WindowServer에서 ASP로 메일 보내기 함수 (0) | 2012.04.24 |
ASP 가로막대그래프 만드는 함수 (0) | 2012.04.24 |
ASP 한글깨짐현상 처리하기 (0) | 2012.04.24 |
XML File Load (0) | 2012.04.24 |