# Check file width PLEASE! :)

**URL:** <https://forum.kirupa.com/t/check-file-width-please/228336>\
**Category:** Uncategorized\
**Created:** [June 7, 2007, 12:21am UTC](https://forum.kirupa.com/t/check-file-width-please/228336 "2007-06-07T00:21:43Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![dentricrio](https://avatars.discourse-cdn.com/v4/letter/d/858c86/32.png) [@dentricrio](https://forum.kirupa.com/u/dentricrio)\
**Post date:** [June 7, 2007, 12:21am UTC](https://forum.kirupa.com/t/check-file-width-please/228336/1 "2007-06-07T00:21:43Z")

</div>

Hi im trying to check the width of a file being upload to the file i then want it to display the error if its more than 150px but i cant get it to work, PLEASE PLEASE can some one help me with it. heres the code so far:

```php
(list($width) = getimagesize($HTTP_POST_FILES['img1']));
     if ($width < 151 AND !isset($error));{
$error = "$width<b>Error: File must be 150x150px or below. </b><br><br>";
unlink($HTTP_POST_FILES['img1']['tmp_name']);    

}

```
