Click or drag to resize

기본 업로드

TABS Upload 컴포넌트를 사용한 가장 간단한 형태의 업로드 프로그래밍 예를 설명합니다. 웹에서 파일 업로드를 하기 위해서는 기본적으로 두 가지 ASP 페이지가 필요합니다. 하나는 업로드 폼을 출력하는 페이지로 사용자에게 파일 업로드를 위한 양식을 제공합니다. 다른 하나는 사용자가 폼에서 업로드 버튼을 클릭할 경우 실제 업로드되는 데이터를 처리하는 페이지입니다.

form.asp

사용자 파일 업로드 입력 양식

ASP
<html>
<head>
    <title>Upload Example</title>
</head>
<body>
<form method="post" ENCTYPE="multipart/form-data" action="upload.asp">
    <input type="text" name="userName">
    <input type="file" name="uploadFile">
    <input type="submit" name="submit" value="Upload">
</form>
</body>
</html>
upload.asp

파일 업로드 처리 페이지

ASP
<%@ LANGUAGE="VBSCRIPT" %>
<html>
<head>
    <title>Upload Results</title>
</head>
<body>
<%
'업로드 컴포넌트를 생성합니다.
Set Upload = Server.CreateObject("TABSUpload4.Upload")
'업로드 데이터 처리를 시작합니다.
Upload.Start "C:\Temp"

'폼 데이터를 출력합니다.
Response.Write Upload.Form("userName")
'업로드된 파일을 저장합니다.
Upload.Form("uploadFile").Save "C:\Storage\UploadFiles"
%>
</body>
</html>