Results 1 to 6 of 6

Thread: Picture size check script?!

  1. #1

    Thread Starter
    Lively Member Geemark's Avatar
    Join Date
    Aug 2002
    Location
    At the pc wasting my worthless time
    Posts
    89

    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.

  2. #2
    Hyperactive Member
    Join Date
    Dec 2001
    Location
    Dublin, Ireland
    Posts
    262
    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.

  3. #3

    Thread Starter
    Lively Member Geemark's Avatar
    Join Date
    Aug 2002
    Location
    At the pc wasting my worthless time
    Posts
    89
    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.

  4. #4
    Hyperactive Member
    Join Date
    Dec 2001
    Location
    Dublin, Ireland
    Posts
    262
    Be nice if you posted your solution when you find it

  5. #5

    Thread Starter
    Lively Member Geemark's Avatar
    Join Date
    Aug 2002
    Location
    At the pc wasting my worthless time
    Posts
    89
    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.

  6. #6
    Hyperactive Member
    Join Date
    Dec 2001
    Location
    Dublin, Ireland
    Posts
    262
    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
  •  



Click Here to Expand Forum to Full Width