SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Zealot ozonew4m's Avatar
    Join Date
    Apr 2006
    Location
    at my desk
    Posts
    136
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Cool best way to validate/download download/validate remote img file

    greeting everybody

    Im building a simple php aplication for my website that requires visitors to enter the url of an image on the internet which my script will then download to my local server so that the visitor can manipulate the image with the gd library..

    my question is..

    what would be the best way to validate that a) the file exists, b) that the file is actually an image.

    is it possible to do the validation without first downloading the image?

    I know that maliscious code can be embedded in images so ideally i would like to do the validation remotely but any guidance on the best method would be appreciated

    thanks

  2. #2
    Always A Novice bronze trophy
    K. Wolfe's Avatar
    Join Date
    Nov 2003
    Location
    Columbus, OH
    Posts
    2,079
    Mentioned
    53 Post(s)
    Tagged
    0 Thread(s)
    Have a look here: http://stackoverflow.com/questions/6...h-image-upload

    You'll still have to bring the file local. Delete the file if it returns false.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •