There can be restrictions on the user groups like new users can’t upload, people with more than X posts can upload it but in a limited size, seniors, mods, admins can always upload longer size.
Mike if you were to do this, I hope you have a very large hard drive space on the server to handle the files that might be uploaded (wav files tend to be a lot larger than mp3), not to mention the bandwidth allowance with all the playback that might happen. Certainly it’s a great idea - just want to be sure you don’t over extend yourself on this.
I really believe it is a must have feature for a community like MRC. There is no need to waste/use own resources as there is an alternative way to make this happen Check it out..
Malware could be renamed something.wav but it won’t be able to execute in it’s current format. Mike could restrict uploads using $file_size to limit someone uploading a huge file and then use $file_type to limit the style of file being uploaded.
depending on what he is using he could add something like this to his upload page.
if (isset ( $_FILES['uploaded_file'] ) ) {
$file_size = $_FILES['uploaded_file']['size'];
$file_type = $_FILES['uploaded_file']['type'];
if (($file_size > 10485760)){
$message = 'Audio file too large. File must be less than 10 megabytes.';
echo '<script type="text/javascript">alert("'.$message.'");</script>';
}
elseif (
($file_type != "audio/wav") &&
($file_type != "audio/mp3") &&
($file_type != "audio/aiff") &&
($file_type != "audio/ses")
){
$message = 'Invalid file type. Only WAV, MP3, AIFF and SES types are accepted.';
echo '<script type="text/javascript">alert("'.$message.'");</script>';
}
else {
store_uploaded_file($id);
}
}
something you might want to try, and it’s pretty neat to see it but take an image file; image.jpg and rename it to image.txt then open the file. In order for the malware to run it would need a file to convert it back to the .exe or .php extension for it to execute. Not saying it can’t be done another way but as long as you have some precautions in place, 99% of the time, you should be okay.
As a fellow Discourse forum hoster (I manage a lot of forums for others), I can personally recommend this Discourse plugin for oneboxed audio uploads: GitHub - scossar/basic-audio-onebox: allows audio file uploads to be oneboxed It should be safe as it checks the audio file for actual audio before oneboxing it. It also recognizes audio files not uploaded to the site, like a public audio file for instance. It also looks good and loads fast as it uses the browsers built-in HTML5 audio player. @Mike If you want anything changed for the plugin before using it, I’d be happy to modify it to your needs.
I’ve already mentioned MELOCITY on here. https://melosity.com/
We/Mike could set up a group account and share audio files between everyone.
thereby keeping the sources off-site.
I’m pleased to announce that this is now a feature!
The forum will automatically convert your audio file into a native browser audio player
You can upload audio (MP3 only) up to 3 MB in size. This means with format settings of MP3 128 Kbps CBR you should be able to upload an audio file of just over 3 minutes in duration.
Perfect for sharing demos, samples or any audio you’d like to share or receive feedback on. There’s even a new Share Your Projects category which is perfect for sharing audio!