Jump to content

Image Upload


.Darkman

Recommended Posts

Hello,

 

I need some help regarding image upload in a form.

 

The form is for submitting tutorials, like on http://good-tutorials.com

 

What i'd like is :

  .jpg or .gif will be allowed

  maximum size of 50KB

  no limit on dimensions since they will be resized to 40 x 40

  they will be converted into .jpg

  and they should be renamed into the ID of the tutorial.

 

Unfortunately i'm not much experienced with this.

So i'd be grateful to anyone who can help.

 

 

Thanks,

Link to comment
https://forums.phpfreaks.com/topic/46382-image-upload/
Share on other sites

Hi,

 

you can get the image information using the $_FILES (global), you can get from this array the following information:

 

[name] => babytux.jpg

[type] => image/jpeg

[tmp_name] => /tmp/phptxlGnO

[error] => 0

=> 41189

 

Here you have everything but the dimensions and some aditional information, this can be done with the function: getimagesize

http://www.php.net/manual/en/function.getimagesize.php

 

Dymon

Link to comment
https://forums.phpfreaks.com/topic/46382-image-upload/#findComment-225609
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.