homepage Welcome to WebmasterWorld Guest from
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!

10+ Year Member

Msg#: 3301 posted 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



WebmasterWorld Senior Member txbakers us a WebmasterWorld Top Contributor of All Time 10+ Year Member

Msg#: 3301 posted 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.


WebmasterWorld Senior Member 5+ Year Member

Msg#: 3301 posted 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:

<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);
<body bgcolor="#000000" onload='FitPic();' topmargin="0"
marginheight="0" leftmargin="0" marginwidth="0">
<script language='javascript'>
document.write( "<img src='" + picUrl + "' border=0>" );

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");

This is the function to initially open the window to 200x200(this can be whatever).


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