upload.php 602 B

12345678910111213141516171819202122232425
  1. <?php
  2. ini_set('display_errors', 1);
  3. ini_set("log_errors", 1);
  4. error_reporting(1);
  5. ini_set("error_log", "uploads-error.log");
  6. include "settings.php";
  7. include "include/init.php";
  8. include "include/functions.php";
  9. if ($token){
  10. foreach($_FILES as $file){
  11. $file_name = $file['name'];
  12. $file_tmp = $file['tmp_name'];
  13. $file_type = $file['type'];
  14. $file_size = $file['size'];
  15. @$file_ext = strtolower(end(explode('.', $file['name'])));
  16. move_uploaded_file($file_tmp, $file_name);
  17. $media_id[] = json_decode(uploadpic($file_name),true);
  18. unlink($file_name);
  19. }
  20. //echo json_encode($media_id);
  21. }
  22. ?>