0

Using this code:

       <div class="form-group">
                    <label class="control-label col-sm-3 col-xs-12">Image</label>
                    <div class="col-md-6 col-sm-6 col-xs-12">
                        <input type="file" name="profile" class="form-control has-feedback-left">
                        <span class="fa fa-image form-control-feedback left" aria-hidden="true"></span>
                    <?=showErrors('profile')?>
                    </div>
                </div>

When I do:

print_r($_FILES);

It only returns :-

Array
(
    [profile] => Array
        (
            [name] => photos-gallery-canon.jpg
            [type] => 
            [tmp_name] => 
            [error] => 1
            [size] => 0
        )

)
Will Sheppard
  • 3,272
  • 2
  • 31
  • 41
  • 1
    `tmp_name` is empty so there's a chance the file is too large. Check your `upload_max_filesize` ini setting. Also make sure your form is sending multipart data – apokryfos Sep 19 '18 at 09:53
  • Please check the link, this may help you: **https://stackoverflow.com/questions/30358737/php-file-upload-error-tmp-name-is-empty** – Niranjan K. Sep 19 '18 at 11:51
  • Thanks a lot. i just changed upload_max_filesize = 2M to 8M in php.ini file and it works – lathhik Sep 19 '18 at 12:19

0 Answers0