Teknik is a suite of services with attractive and functional interfaces. https://www.teknik.io/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

upload_podcast.php 676B

123456789101112131415161718192021222324252627
  1. <?php
  2. require_once('../includes/config.php');
  3. if (isset($_FILES['file']))
  4. {
  5. if ($logged_in && $user->admin)
  6. {
  7. $tempFile = $_FILES['file']['tmp_name'];
  8. $fileType = pathinfo($_FILES['file']['name'], PATHINFO_EXTENSION);
  9. $name = 'Teknik_Podcast_'.date('Y-m-d', time()).'.'.$fileType;
  10. $path = $CONF['podcast_dir'].$name;
  11. move_uploaded_file($tempFile, $path);
  12. echo json_encode(array("file" => array("name" => $name, "path" => $CONF['podcast_dir'])));
  13. }
  14. else
  15. {
  16. echo json_encode(array("error" => $CONF['errors']['NoAuth']));
  17. }
  18. }
  19. else
  20. {
  21. echo json_encode(array("error" => $CONF['errors']['NoFile']));
  22. }
  23. ?>