dongmi1995 2019-07-27 04:55
浏览 32
已采纳

在codeigniter中上传具有特定宽度和高度的图像

I am trying to add banners from the admin panel. I want to upload images only 1920 width and 700 height images. I don't want to allow if the image width is less then 1920 or bigger than 1920 pixels.

How can I do this? Please help me.

Please check my code.

 $banner_config['min_width'] = 1920;
 $banner_config['min_height'] = 700;

I tried this but not working

 $banner_config['width'] = 1920;
 $banner_config['height'] = 700;
  • 写回答

1条回答 默认 最新

  • dongsechuan0535 2019-07-27 05:03
    关注

    Try this

    $banner_config['min_width'] = 1920;
    $banner_config['min_height'] = 700;
    $banner_config['max_width'] = 1920;
    $banner_config['max_height'] = 700;
    

    For reference: File Uploading Preferences

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 乌班图ip地址配置及远程SSH
  • ¥15 怎么让点阵屏显示静态爱心,用keiluVision5写出让点阵屏显示静态爱心的代码,越快越好
  • ¥15 PSPICE制作一个加法器
  • ¥15 javaweb项目无法正常跳转
  • ¥15 VMBox虚拟机无法访问
  • ¥15 skd显示找不到头文件
  • ¥15 机器视觉中图片中长度与真实长度的关系
  • ¥15 fastreport table 怎么只让每页的最下面和最顶部有横线
  • ¥15 java 的protected权限 ,问题在注释里
  • ¥15 这个是哪里有问题啊?