forked from addpipe/simple-recorderjs-demo
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added upload feature using XMLHttpRequest
- Loading branch information
Showing
2 changed files
with
44 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<?php | ||
print_r($_FILES); //this will print out the received name, temp name, type, size, etc. | ||
|
||
|
||
$size = $_FILES['audio_data']['size']; //the size in bytes | ||
$input = $_FILES['audio_data']['tmp_name']; //temporary name that PHP gave to the uploaded file | ||
$output = $_FILES['audio_data']['name'].".wav"; //letting the client control the filename is a rather bad idea | ||
|
||
//move the file from temp name to local folder using $output name | ||
move_uploaded_file($input, $output) | ||
?> |