限制图片上传大小

时间:2016-05-03 06:04:11

标签: javascript

如何将图片上传大小限制在100kb到2 MB

<form id="formId" action="<?php echo Mage::getUrl('fanbook/index/fanbook') ?>" method="post"
      enctype="multipart/form-data" name="upload" onsubmit="return checkFile();">
          <input type="hidden" name="form_key" value="<?php echo Mage::getSingleton('core/session')->getFormKey() ?>">

        <div id="upload-file-container">
            <input id="img" type="file" name="img">
        </div> 
            <input id="button" type="submit" value="Submit" name="submit" class="submit" onClick="getSize();">
    </form>

0 个答案:

没有答案