.Net Project/Jquery 1.3.2

90장 JQueryModel 파일 업로드 jQuery + Uploadify + ASP.NET (Uploadify.htm)

래곤 2009. 11. 25. 13:44
반응형


 Uploadify.htm
 

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

 

<html xmlns="http://www.w3.org/1999/xhtml">

<head>

    <title>파일 업로드 : jQuery + Uploadify + ASP.NET</title>

    <link href="uploadify.css" rel="stylesheet" type="text/css" />

    <script src="../../js/jquery-1.3.2-vsdoc2.js" type="text/javascript"></script>

    <script src="jquery.uploadify.v2.1.0.js" type="text/javascript"></script>

    <script src="swfobject.js" type="text/javascript"></script>

    <script type="text/javascript">

        $(document).ready(function () {

        $('#fileInput').uploadify({

                'uploader': 'uploadify.swf', // Uploadify 컨트롤 지정

                'script': 'uploadify.ashx',  // 스크립트 ASP.NET, ASP, PHP, JSP

                'cancelImg': 'cancel.png',   // 취소 이미지

                'auto': false, // true 파일 선택시 바로 자동으로 업로드 됨

                'folder': '/Uploads', //업로드 할 폴더 : 가상 디렉터리 + 업로드 폴더

                // 업로드 완료 시 처리

                // 주요 속성은...  
                
http://www.uploadify.com/documentation/ uÆi

                'onComplete': function (event, queueID, fileObj, response, data) {

                    $('#lblFile').append(

                    '<a href="/WebJQuery' + fileObj.filePath + '">'

                    + fileObj.name + '</a><br>');

                }

            });

            // 버튼 클릭시 업로드

            $('#btn').click(function () { $('#fileInput').uploadifyUpload(); });

        });

    </script>

</head>

<body>

    <input id="fileInput" name="fileInput" type="file" />

    <input type="button" id="btn" value="업로드" />

    <div id="lblFile"></div>

</body>

</html> 




반응형