Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: ASP file
how to check upload file content type in classic asp?
Posted 27-Jan-13 22:14pm
Comments
ujju.1 at 28-Jan-13 3:20am
   
what exactly you want to check??
AdityaPratapSingh at 28-Jan-13 3:37am
   
i want to check content type of uploaded file.
lindam88 at 8-Mar-13 21:47pm
   
log on to this site, you will learn more-->http://www.sitepoint.com/forums/showthread.php?157726-Validate-User-s-upload-file-in-ASP
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 3

<%@  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>
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

try this link
 
http://globalbanke.com/uploadFiles.asp?CustomName=Red
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

what do you exactly want to check??
  Permalink  

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

  Print Answers RSS
0 Marcin Kozub 330
1 OriginalGriff 256
2 Sergey Alexandrovich Kryukov 215
3 Praneet Nadkar 197
4 Richard MacCutchan 182
0 OriginalGriff 8,048
1 Sergey Alexandrovich Kryukov 7,287
2 DamithSL 5,614
3 Manas Bhardwaj 4,986
4 Maciej Los 4,910


Advertise | Privacy | Mobile
Web02 | 2.8.1411023.1 | Last Updated 4 May 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100