upload.php 666 B

123456789101112131415161718192021222324252627
  1. <?php
  2. ini_set('display_errors', 1);
  3. ini_set("log_errors", 1);
  4. ini_set("error_log", "php-error.log");
  5. error_reporting(E_ALL);
  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. //$file_name = "tmp/".$file_name;
  17. $file_name = $file_name;
  18. move_uploaded_file($file_tmp, $file_name);
  19. $media_id[] = json_decode(uploadpic($file_name),true);
  20. unlink($file_name);
  21. }
  22. echo json_encode($media_id);
  23. }
  24. ?>