Forums

ASP

This topic is locked

PureASPUpload error in code

Posted 21 Jun 2002 23:08:11
1
has voted
21 Jun 2002 23:08:11 Richard Sheridan posted:
I'm getting a message from Internet Explorer indicating page loaded but with errors. I'm using the PureASPUpload + Delete File before upload behavior and the following is my code which in UltraDev is appearing in bright yellow. Please check some and let me know? thanks Rich

function checkFileUpload
(form,extensions,requireUpload,sizeLimit,minWidth,minHeight,maxWidth,max
Height,saveWidth,saveHeight) { //v2.09
document.MM_returnValue = true;
for (var i = 0; i<form.elements.length; i++) {
field = form.elements[i];
if (field.type.toUpperCase() != 'FILE') continue;
checkOneFileUpload
(field,extensions,requireUpload,sizeLimit,minWidth,minHeight,maxWidth,ma
xHeight,saveWidth,saveHeight);
} }
>
function checkOneFileUpload
(field,extensions,requireUpload,sizeLimit,minWidth,minHeight,maxWidth,ma
xHeight,saveWidth,saveHeight) { //v2.09
document.MM_returnValue = true;
if (extensions != '') var re = new RegExp("\.(" + extensions.replace
(/,/gi,"|".replace(/\s/gi,"" + "$","i";
if (field.value == '') {
if (requireUpload) {alert('File is
required!');document.MM_returnValue = false;field.focus();return;}
} 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;
re = new RegExp(".(gif|jpg|png|bmp|jpeg)$","i";
if(re.test(field.value) && (sizeLimit != '' || minWidth != '' ||
minHeight != '' || maxWidth != '' || maxHeight != '' || saveWidth != ''
|| saveHeight != '')) {
checkImageDimensions
(field,sizeLimit,minWidth,minHeight,maxWidth,maxHeight,saveWidth,saveHei
ght);
} }
}

Reply to this topic