Click here to Skip to main content
15,902,635 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I want File Upload & download in classic asp.
Posted

XML
<%@  language="VBScript" %>
<!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></title>
    <script language="javascript" type="text/javascript">
        function checkImage(img) {
            if (img != '' && img.substring(img.length - 3, img.length).toLowerCase() != 'jpg' && img.substring(img.length - 3, img.length).toLowerCase() != 'gif' && img.substring(img.length - 3, img.length).toLowerCase() != 'bmp' && img.substring(img.length - 3, img.length).toLowerCase() != 'png')
                return true
            else
                return false
        }
        function check() {
            var str = '';
            var strFocus = '';
            var img = document.frmCategory.Cat_Image.value;
            if (checkImage(img)) {
                str += "Select proper image.";
                if (strFocus == '') strFocus = 'Cat_Image';
            }
            if (str != '') {
                alert(str);
                if (document.getElementById(strFocus) != null)
                    document.getElementById(strFocus).focus();
                return false;
            }
        }
    </script>
</head>
<body>
    <form method="post" action="" id="frmCategory" name="frmCategory" onsubmit="return check();">
    <input type="file" id="Cat_Image" name="Cat_Image" value="" />
    <img src="images/save.jpg" alt="Save" width="60" height="20" border="0" onclick="javascript:check();" />
    </form>
</body>
</html>


AND

For download Just assign full path of the file location. like Click here
 
Share this answer
 
v8

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900