|
-
Oct 16th, 2002, 10:41 AM
#1
Thread Starter
Lively Member
Picture size check script?!
I thought with the new oppertunities with ASP.NET (e.g. compiled DLLs etc.) I thought it would be possible to create a library that checks the width and height of a picture?
I am using this to limit the size of pictures posted on my forum.
I know PHP has built-in features for this purpose, but ASP.NET ...?!
Machine Language: You try to shoot yourself in
the foot only to discover you must first reinvent the
gun, gunpowder, the bullet, and your foot.
-
Oct 17th, 2002, 06:33 PM
#2
Hyperactive Member
With the "PostedFile" object you may be able to check attributes of the file. If there is a way to do it in php it may be along similar lines but I'm guessing.
There was an upload script for asp that limited image dimensions but it checked on the client presumably using javascript. You might want to search for a javascript that will do this.
Last edited by Musician; Oct 17th, 2002 at 06:40 PM.
-
Oct 18th, 2002, 08:43 AM
#3
Thread Starter
Lively Member
Never mind, I figured it out - got help on an ASP.NET forum...
Only two lines of code needed :-) And no, it's not the postedfile object
Machine Language: You try to shoot yourself in
the foot only to discover you must first reinvent the
gun, gunpowder, the bullet, and your foot.
-
Oct 19th, 2002, 04:20 PM
#4
Hyperactive Member
Be nice if you posted your solution when you find it
-
Oct 20th, 2002, 10:38 AM
#5
Thread Starter
Lively Member
Of course. How silly of me :-) I was in a bit of a hurry :-)
http://www.asp.net/Forums/ShowPost.a...1&PostID=69832
(hope I'm not banned for referring to another forum heh)
Machine Language: You try to shoot yourself in
the foot only to discover you must first reinvent the
gun, gunpowder, the bullet, and your foot.
-
Oct 20th, 2002, 11:18 AM
#6
Hyperactive Member
I suspected it might be that. I did not suggest the drawing namspace to you because I assumed you did not wish to allow the upload for pictures of certain dimensions.
The code example will work fine but bear in mind you have to allow the upload and save it to your server before you can check it and presumably then delete it if it is not the correct dimensions.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|