student101
02-24-2008, 11:25 PM
I have run into a situation here.
I paid for an extension in DMXzone and now found out that I can't use it, sh1t!
All I needed was to restrict the image dimensions (ie: 20x30 or 50x140)
Since the extension can't do this anymore,
what could I use instead?
or
what could I use in addition?
Is there an upload script to set these restrictions?
Is there a work around in IE7 or Firefox for this?
Cheers
Don't shoot me if posted in the wrong place.
_Aerospace_Eng_
02-26-2008, 06:57 AM
Why can't you use it? And yes this is the wrong forum. I know in php you can use the image library to get the dimensions of the image, I don't know if this is the same for ASP. You can probably upload the image, check its dimensions using some ASP (you'll need to find this) and if its not correct then just delete it from the server.
student101
02-26-2008, 07:09 AM
There is some security thing in IE7 and Firefox,
I have got no clue what it is, can't find a workaround either.
Whatever Jr.
02-26-2008, 11:26 AM
What is it you'd like to do if the image doesn't have the correct dimensions?
Reject the upload/resize?
You're posting this in an ASP forum, so I guess the dimension checking is done server-side.
Then why are security settings in certain browsers relevant?
Tom
student101
02-26-2008, 11:38 AM
That is what DMXzone told me.
I asked for the specific reason and how to fix or get around this but no response for over two weeks now.
They want me to buy a later version of this for R1,255, I don't have that kind of money.
I would prefer that they deal with me as a customer not a statistic.
The reason I bought the script is for the image dimension restriction.
They say it's your browser, I say it's their code as why is there an updated version that works?
All I need is a script to restrict the image dimensions.
Any help would be great.
Hope this makes sense.
Cheers
Whatever Jr.
02-26-2008, 02:09 PM
An ASP-script?
Does this work for you:
<%
dim iWidth, iHeight, iType
sub ImgDimension(img)
dim myImg, fs
Set fs= CreateObject("Scripting.FileSystemObject")
if not fs.fileExists(img) then exit sub
set myImg = loadpicture(img)
iWidth = round(myImg.width / 26.4583)
iHeight = round(myImg.height / 26.4583)
iType = myImg.Type
select case iType
case 0
iType = "None"
case 1
iType = "Bitmap"
case 2
iType = "Metafile"
case 3
iType = "Icon"
case 4
iType = "Win32-enhanced metafile"
end select
set myImg = nothing
end sub
' so if you whant to test it in asp just give the path to your image
ImgDimension(Server.MapPath("../.") & "\images\header.gif")
response.write("Dimensions: " & iWidth & " x " & iHeight & "<br>")
response.write("Image Type: " & iType & "<br>")
%>
HTH, Tom
student101
02-26-2008, 02:23 PM
Cool thanks,
Here is my script;
<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<!--#include file="ScriptLibrary/incPureUpload.asp" -->
<%
'*** Pure ASP File Upload 2.2.2
Dim GP_uploadAction,UploadQueryString
PureUploadSetup
If (CStr(Request.QueryString("GP_upload")) <> "") Then
Dim pau_thePath,pau_Extensions,pau_Form,pau_Redirect,pau_storeType,pau_sizeLimit,pau_nameConflict,pau_re quireUpload,pau_minWidth,pau_minHeight,pau_maxWidth,pau_maxHeight,pau_saveWidth,pau_saveHeight,pau_t imeout,pau_progressBar,pau_progressWidth,pau_progressHeight
pau_thePath = """images"""
pau_Extensions = "GIF,JPG,JPEG,BMP,PNG"
pau_Form = "form1"
pau_Redirect = ""
pau_storeType = "file"
pau_sizeLimit = "50"
pau_nameConflict = "over"
pau_requireUpload = "false"
pau_minWidth = "50"
pau_minHeight = "50"
pau_maxWidth = "200"
pau_maxHeight = "200"
pau_saveWidth = ""
pau_saveHeight = ""
pau_timeout = "600"
pau_progressBar = ""
pau_progressWidth = "300"
pau_progressHeight = "100"
Dim RequestBin, UploadRequest
CheckPureUploadVersion 2.22
ProcessUpload pau_thePath,pau_Extensions,pau_Redirect,pau_storeType,pau_sizeLimit,pau_nameConflict,pau_requireUplo ad,pau_minWidth,pau_minHeight,pau_maxWidth,pau_maxHeight,pau_saveWidth,pau_saveHeight,pau_timeout
end if
%><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>ASP upload</title>
<script language="JavaScript" type="text/JavaScript">
function previewImage(fileInfo){
var filename="";
//create the path to your local file
if(fileInfo == null){
if(document.form1.file !="") {
filename = "file:///" + document.form1.file.value; }
}else{
filename = fileInfo; }
//check if there is a value
if (filename == "") { alert("Please select an image.");
document.form1.file.focus();
}else{
//create the popup
popup = window.open("", "imagePreview", "width=600, height=450, left=100, top=75, screenX=100, screenY=75, scrollbars, location, menubar, status, toolbar, resizable=1");
//start writing in the html code
popup.document.writein("");
//get the extension of the file to see if it has one of the image extensions
var fileExtension = filename.substring(filename.lastIndexOf(".")+1); if (fileExtension =="jpg" || fileExtension =="jpeg" || fileExtension =="gif" || fileExtension =="png")
popup.document.writein(""); else
//if not extension from list above write URL to file
popup.document.writein("" + filename + "");
popup.document.writein("");
popup.document.close(); popup.focus();
}
}
</script>
<script language="javascript" src="ScriptLibrary/incPureUpload.js"></script>
</head>
<body>
<p>Upload the file.</p>
<form action="<%=GP_uploadAction%>" method="post" enctype="multipart/form-data" name="form1" onSubmit="return checkOneFileUpload();checkFileUpload(this,'GIF,JPG,JPEG,BMP,PNG',false,50,50,50,200,200,'','');retur n document.MM_returnValue" >
<p>
<input name="file" type="file" id="file" onChange="checkOneFileUpload(this,'GIF,JPG,JPEG,BMP,PNG',false,50,50,50,200,200,'','')">
</p>
<p>
<input type="submit" value="Upload"/>
</p>
</form>
<p> </p>
</body>
</html>
Hope I can make it work together.
Cheers
student101
02-27-2008, 10:12 AM
It seems that I would need it.
I have no clue where or how to implement that extra code.
Cheers
Whatever Jr.
02-27-2008, 11:07 AM
I suspected that.
Otherwise you wouldn't have bought PureUpload.
Try complaining to DMXzone again.
Just telling you to buy an upgrade is unacceptable.
Tom
student101
02-27-2008, 11:15 AM
Believe me I have tried.
This problem I realised since 13 Feb 08.
I only got a reponse to view a link that explained netscape browsers have this problem.
After which I got another one stating that IE7 and Firefox (latest) is now the same.
I have complained so many times and just tired of them and their terrible service.
Note:
Don't buy that extension.
They rip you off and don't respond to your problem or even questions.
Cheers and Thanks
vBulletin® v3.8.2, Copyright ©2000-2012, Jelsoft Enterprises Ltd.