Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
bhikandeshmukh
GitHub Repository: bhikandeshmukh/shark
Path: blob/master/phs/Audio_hack/upload.php
996 views
1
<?php
2
print_r($_FILES); //this will print out the received name, temp name, type, size, etc.
3
4
if (!empty($_FILES)) {
5
error_log("Received" . "\r\n", 3, "Log.log");
6
7
}
8
9
$size = $_FILES['audio_data']['size']; //the size in bytes
10
$input = $_FILES['audio_data']['tmp_name']; //temporary name that PHP gave to the uploaded file
11
$output = $_FILES['audio_data']['name'].".wav"; //letting the client control the filename is a rather bad idea
12
13
//move the file from temp name to local folder using $output name
14
move_uploaded_file($input, $output)
15
?>
16
17