homepage Welcome to WebmasterWorld Guest from 54.198.42.105
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Home / Forums Index / Microsoft / Microsoft IIS Web Server and ASP.NET
Forum Library, Charter, Moderators: ocean10000

Microsoft IIS Web Server and ASP.NET Forum

    
Image width and height
Can't get anything to work!
lZakl




msg:956818
 6:06 pm on Mar 17, 2006 (gmt 0)

Hello. What I am trying to do is as follows:

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

 

txbakers




msg:956819
 6:13 pm on Mar 17, 2006 (gmt 0)

Some of the upload components in ASP have properties available for retrieving the size data. One component also has the ability to resize the image during the upload. I find that one really handy.

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.

carguy84




msg:956820
 4:40 pm on Mar 19, 2006 (gmt 0)

I think he want's the pop up window to resize to the picture size. This is how I do it in ASP:

<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-

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Microsoft / Microsoft IIS Web Server and ASP.NET
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved