Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Snitz Forums 2000 MOD-Group
 MOD Add-On Forum (W/O Code)
 Determining File Size dimensions upon upload?
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

Etymon
Advanced Member

United States
2385 Posts

Posted - 19 March 2003 :  12:48:47  Show Profile  Visit Etymon's Homepage

I have an image upload MOD installed.

What I want to do is find a script that will determine the height and width dimensions and then output them in text for the member to see. It would be really nice if the script (or another) could determine the dimensions of the file to be uploaded "before" it was uploaded.

What I mean is that after the user selects which file to upload, a confirmation would display the file's statistics as in image KB size, image dimensions, etc.

I want the one script to help the user determine which uploaded file to use in their posts and the other script to help the user to determine which file to upload from their computer.

Thanks so much,

Etymon

DavidRhodes
Senior Member

United Kingdom
1222 Posts

Posted - 19 March 2003 :  16:43:24  Show Profile
You can't do this before upload as the server must read the file properties in order to get the size etc.

The UK MkIVs Forum
Go to Top of Page

Deleted
deleted

4116 Posts

Posted - 19 March 2003 :  17:30:37  Show Profile
That can be done via a client size Java application (I don't know Java unfortunately).

Stop the WAR!
Go to Top of Page

dayve
Forum Moderator

USA
5820 Posts

Posted - 19 March 2003 :  19:45:44  Show Profile  Visit dayve's Homepage
quote:
Originally posted by DavidRhodes

You can't do this before upload as the server must read the file properties in order to get the size etc.



sure it can I have a dhtml script I've used to do client side processing of image sizes.

http://hafresno.org/development/imgSize.htm

Go to Top of Page

Deleted
deleted

4116 Posts

Posted - 19 March 2003 :  20:43:59  Show Profile
OK, you can do it . But a couple things are worth to mention (comments are welcome):

  • The width and height properties do not work on some NS & Opera versions and they return 0.

  • The parameters show the rendered width & height (as far as I know), so you have to use the image tag without these tags, so it may render out of the window if it is large. You would like to put a form and a button to start the upload there, and pass the measured values to ASP. You may also want to disable the button until the image is fully loaded.

  • A bit loosely related, but you cannot get the filesize (which may be more important in an upload application)

  • It will not work with JS challenged users.



Thanks for the code

Stop the WAR!
Go to Top of Page

dayve
Forum Moderator

USA
5820 Posts

Posted - 20 March 2003 :  11:00:38  Show Profile  Visit dayve's Homepage
yeah, I failed to mention a few caveats.

Go to Top of Page

Etymon
Advanced Member

United States
2385 Posts

Posted - 20 March 2003 :  12:29:47  Show Profile  Visit Etymon's Homepage

Thanks everyone for the input and for the code, dayve!

What about "after" the image is on my server? Is there a way of determining the height and width and then displaying it to the user?

Thanks again,

Etymon
Go to Top of Page

ROB
Junior Member

USA
347 Posts

Posted - 20 March 2003 :  18:30:57  Show Profile  Visit ROB's Homepage  Send ROB an AOL message  Send ROB an ICQ Message  Send ROB a Yahoo! Message
If your host will consider installing a new component, check out Active BitMapSize II. It will check the pixel dimensions and color depth of the image after uploading (and it's FREE).

The downside to doing the check after uploading is that, well, it's done after the upload (and the time to upload and bandwidth consumed, etc.). But it does work. You could limit the size, return an error if it's too big or whatever... then just delete the uploaded file.

Jeff (ROB) Hester
BigBlueNetwork | BigBlueBall | Christian Church Today
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Topic Locked
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.25 seconds. Powered By: Snitz Forums 2000 Version 3.4.07