Forum Moderators: open
1) Upload an image to server via ASP and store URL in a SQL database. This I have accoplished.
2) Before or after upload, get image width and height to enter into the database so that I can dynamically change the size of my pop-up image window.
I can't seem to find an effective SIMPLE way to get file information in ASP. THis is really starting to get my goat!
Any input is greatly appreciated!
-- Zak
As for displaying it actual size, you don't need to specify the width and height in the link. the image will display at actual size.
<html>
<head>
<title></title>
<script language='javascript'>
var arrTemp=self.location.href.split("?");
var picUrl = (arrTemp.length>0)?arrTemp[1]:"";
picUrl = picUrl + '?' + arrTemp[2];
//alert(picUrl + '?' + arrTemp[2]);
var NS = (navigator.appName=="Netscape")?true:false;
function FitPic() {
iWidth = (NS)?window.innerWidth:document.body.clientWidth;
iHeight = (NS)?window.innerHeight:document.body.clientHeight;
iWidth = document.images[0].width - iWidth;
iHeight = document.images[0].height - iHeight;
window.resizeBy(iWidth, iHeight);
self.focus();
};
</script>
</head>
<body bgcolor="#000000" onload='FitPic();' topmargin="0"
marginheight="0" leftmargin="0" marginwidth="0">
<script language='javascript'>
document.write( "<img src='" + picUrl + "' border=0>" );
</script>
</body>
</html>
You just have to pass the URL of the photo into this page and it will resize the page dynamically:
<script language="Javascript">
function PopupPic(sPicURL) {
window.open( "/popup.asp?"+sPicURL, "", "resizable=1,HEIGHT=200,WIDTH=200");
}
</script>
This is the function to initially open the window to 200x200(this can be whatever).
Chip-