PageRenderTime 45ms CodeModel.GetById 22ms RepoModel.GetById 0ms app.codeStats 0ms

/protected/modules/comments/assets/tests/upload.php

https://bitbucket.org/graaaf/erso
PHP | 20 lines | 13 code | 7 blank | 0 comment | 10 complexity | 1c0c36af657166038482f275bd4fd117 MD5 | raw file
Possible License(s): GPL-3.0, LGPL-3.0, LGPL-2.1, BSD-3-Clause, BSD-2-Clause
  1. <?php
  2. include "../config.php";
  3. $_FILES['file']['type'] = strtolower($_FILES['file']['type']);
  4. if ($_FILES['file']['type'] == 'image/png'
  5. || $_FILES['file']['type'] == 'image/jpg'
  6. || $_FILES['file']['type'] == 'image/gif'
  7. || $_FILES['file']['type'] == 'image/jpeg'
  8. || $_FILES['file']['type'] == 'image/pjpeg')
  9. {
  10. copy($_FILES['file']['tmp_name'], IMAGES_ROOT.md5(date('YmdHis')).'.jpg');
  11. echo '/tmp/images/'.md5(date('YmdHis')).'.jpg';
  12. }
  13. ?>