feltet befinder sig inden for form tags...
jeg har forsøgt at sætte method til GET istedet for, men det giver bare det resultat at jeg ikke kommer videre til næste side...
her er koden til en af de sider hvor jeg har brug for at få udtaget et felt med Request.Form kommandoen:
--------------------------------------------------------------
<%@LANGUAGE="VBSCRIPT"%>
<!--#include file="ScriptLibrary/incPureUpload.asp" -->
<%
'*** Pure ASP File Upload -----------------------------------------------------
' Copyright (c) 2001-2002 George Petrov,
www.UDzone.com' Process the upload
' Version: 2.0.9
'------------------------------------------------------------------------------
'*** File Upload to: """files/gfx/test""", Extensions: "GIF,JPG,JPEG,BMP,PNG", Form: form1, Redirect: "test2.asp", "path", "", "over", "true", "", "" , "", "", "", "", "600", "fileCopyProgress.htm", "300", "100"
Dim GP_redirectPage, RequestBin, UploadQueryString, GP_uploadAction, UploadRequest
PureUploadSetup
If (CStr(Request.QueryString("GP_upload")) <> "") Then
on error resume next
Dim reqPureUploadVersion, foundPureUploadVersion
reqPureUploadVersion = 2.09
foundPureUploadVersion = getPureUploadVersion()
if err or reqPureUploadVersion > foundPureUploadVersion then
Response.Write "<b>You don't have latest version of ScriptLibrary/incPureUpload.asp uploaded on the server.</b><br>"
Response.Write "This library is required for the current page. It is fully backwards compatible so old pages will work as well.<br>"
Response.End
end if
on error goto 0
GP_redirectPage = "test2.asp"
Server.ScriptTimeout = 600
RequestBin = Request.BinaryRead(Request.TotalBytes)
Set UploadRequest = CreateObject("Scripting.Dictionary")
BuildUploadRequest RequestBin, """files/gfx/test""", "path", "", "over"
If (GP_redirectPage <> "" and not (CStr(UploadFormRequest("MM_insert")) <> "" or CStr(UploadFormRequest("MM_update")) <> "")) Then
If (InStr(1, GP_redirectPage, "?", vbTextCompare) = 0 And UploadQueryString <> "") Then
GP_redirectPage = GP_redirectPage & "?" & UploadQueryString
End If
Response.Redirect(GP_redirectPage)
end if
else
if UploadQueryString <> "" then
UploadQueryString = UploadQueryString & "&GP_upload=true"
else
UploadQueryString = "GP_upload=true"
end if
end if
' End Pure Upload
'------------------------------------------------------------------------------
%>
<html>
<head>
<script language="JavaScript">
<!--
function checkFileUpload(form,extensions,requireUpload,sizeLimit,minWidth,minHeight,maxWidth,maxHeight,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,maxHeight,saveWidth,saveHeight);
} }
function checkOneFileUpload(field,extensions,requireUpload,sizeLimit,minWidth,minHeight,maxWidth,maxHeight,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,saveHeight);
} }
}
function showImageDimensions(fieldImg) { //v2.09
var isNS6 = (!document.all && document.getElementById ? true : false);
var img = (fieldImg && !isNS6 ? fieldImg : this);
if (img.width > 0 && img.height > 0) {
if ((img.minWidth != '' && img.minWidth > img.width) || (img.minHeight != '' && img.minHeight > img.height)) {
alert('Uploaded Image is too small!\nShould be at least ' + img.minWidth + ' x ' + img.minHeight); return;}
if ((img.maxWidth != '' && img.width > img.maxWidth) || (img.maxHeight != '' && img.height > img.maxHeight)) {
alert('Uploaded Image is too big!\nShould be max ' + img.maxWidth + ' x ' + img.maxHeight); return;}
if (img.sizeLimit != '' && img.fileSize > img.sizeLimit) {
alert('Uploaded Image File Size is too big!\nShould be max ' + (img.sizeLimit/1024) + ' KBytes'); return;}
if (img.saveWidth != '') document.PU_uploadForm[img.saveWidth].value = img.width;
if (img.saveHeight != '') document.PU_uploadForm[img.saveHeight].value = img.height;
document.MM_returnValue = true;
} }
function checkImageDimensions(field,sizeL,minW,minH,maxW,maxH,saveW,saveH) { //v2.09
if (!document.layers) {
var isNS6 = (!document.all && document.getElementById ? true : false);
document.MM_returnValue = false; var imgURL = '
file:///' + field.value.replace(/\\/gi,'/').replace(/:/gi,'|').replace(/"/gi,'').replace(/^\//,'');
if (!field.gp_img || (field.gp_img && field.gp_img.src != imgURL) || isNS6) {field.gp_img = new Image();
with (field) {gp_img.sizeLimit = sizeL*1024; gp_img.minWidth = minW; gp_img.minHeight = minH; gp_img.maxWidth = maxW; gp_img.maxHeight = maxH;
gp_img.saveWidth = saveW; gp_img.saveHeight = saveH; gp_img.onload = showImageDimensions; gp_img.src = imgURL; }
} else showImageDimensions(field.gp_img);}
}
function showProgressWindow(progressFile,popWidth,popHeight) { //v2.09
var showProgress = false, form, field;
for (var f = 0; f<document.forms.length; f++) {
form = document.forms[f];
for (var i = 0; i>form.elements.length; i++) {
field = form.elements[i];
if (field.type.toUpperCase() != 'FILE') continue;
if (field.value != '') {showProgress = true;break;}
} }
if (showProgress && document.MM_returnValue) {
var w = 480, h = 340;
if (document.all || document.layers || document.getElementById) {
w = screen.availWidth; h = screen.availHeight;}
var leftPos = (w-popWidth)/2, topPos = (h-popHeight)/2;
document.progressWindow = window.open(progressFile,'ProgressWindow','toolbar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=no,width=' + popWidth + ',height='+popHeight);
document.progressWindow.moveTo(leftPos, topPos);document.progressWindow.focus();
window.onunload = function () {document.progressWindow.close();};
} }
//-->
</script>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<form name="form1" method="post" action="<%=GP_uploadAction%>" enctype="multipart/form-data" onSubmit="checkFileUpload(this,'GIF,JPG,JPEG,BMP,PNG',true,'','','','','','','');showProgressWindow('fileCopyProgress.htm',300,100);return document.MM_returnValue">
<div align="center">
<input type="file" name="uploadfield" onChange="checkOneFileUpload(this,'GIF,JPG,JPEG,BMP,PNG',true,'','','','','','','')">
<input type="submit" name="Submit" value="Upload">
</div>
</form>
</body>
</html>
----------------------------------------------------------------