dcsimg
www.webdeveloper.com
Results 1 to 6 of 6

Thread: Resize image on upload - PHP

  1. #1
    Join Date
    Jul 2009
    Posts
    23

    Exclamation Resize image on upload - PHP

    Hello all,

    I have created a fairly simple script that accompanies a form enabling a user to upload an image to my website. The problem I have is I want to scale the image on upload so that it is stored at the smaller size of 110 x 104.

    Are there a few lines of code that I can add to scale the image when the user uploads it?

    Any help at all would be HUGELY appreciated. Thank you in advance.

  2. #2
    Join Date
    Jan 2007
    Location
    Wisconsin
    Posts
    2,120

  3. #3
    Join Date
    Jul 2009
    Posts
    23
    Quote Originally Posted by svidgen View Post
    Thank's alot for your help, this works a treat at resizing the image.

    However, how can I then save the scaled image so that it can be used instead of the original one that was uploaded?

  4. #4
    Join Date
    Jan 2007
    Location
    Wisconsin
    Posts
    2,120
    See http://us.php.net/manual/en/ref.filesystem.php.

    In particular, file_put_contents() will probably suit your needs.
    Last edited by svidgen; 10-20-2009 at 10:29 AM. Reason: typo ...

  5. #5
    Join Date
    Jul 2009
    Posts
    23
    Quote Originally Posted by svidgen View Post
    See http://us.php.net/manual/en/ref.filesystem.php.

    In particular, file_put_contents() will probably suit your needs.
    Thank you very much, you're a life saver, that's exactly what I'm looking for!

  6. #6
    Join Date
    Jan 2007
    Location
    Wisconsin
    Posts
    2,120
    Savvy.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

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



Recent Articles