JavaScript Upload Validation & ASP

wxdqz

New Member
Please can somebody shed some light on something for me
i do not know the first thing about Java and as far as i can ascertain the script that i have pasted below changes and check the extension before uploading it(part of an ASP Application!)
What happens is it will only allow filenames that are in capital to be uploaded ! How can i change it to load any CASE files ?
it also check other things like the extension and size
But it is the CASE Problem that is stopping it from working
This Problem is Driving me nuts @ Peanuts!
==================================================
==================
<script language="JavaScript">
<!--
function checkFileUpload(form,extensions,requireUpload,size
Limit,minWidth,minHeight,maxWidth,maxHeight) { //v2.09
document.MM_returnValue = true;
for (var i = 0; i<form.elements.length; i++) {
field = form.elements;
if (field.type.toUpperCase()!= 'FILE') continue;
checkOneFileUpload(field,extensions,requireUpload,
sizeLimit,minWidth,minHeight,maxWidth,maxHeight);
} }
function checkOneFileUpload(field,extensions,requireUpload,
sizeLimit,minWidth,minHeight,maxWidth,maxHeight) { //v2.09
document.MM_returnValue = true;
if (extensions != '') var re = new RegExp("\.(" + extensions.replace(/,/gi,"|").replace(/\s/gi,"") + ")$","i");
if (field.value == '') {
} else {
if(extensions != '' && !re.test(field.value)) {
alert('This file type is not allowed for uploading.\nOnly the following file extensions are allowed: ' + extensions + '.\nPlease select another file and try again.');
document.MM_returnValue = false;field.focus();return;
}
document.PU_uploadForm = field.form;
var re = new RegExp(".(gif|jpg|png|jpeg)$","i");
if(re.test(field.value) && (sizeLimit != '' || minWidth != '' || minHeight != '' || maxWidth != '' || maxHeight != '')) {
checkImageDimensions(field,sizeLimit,minWidth,minH
eight,maxWidth,maxHeight);
} }
}
 
Back
Top