View Full Version : Script for Uploading Files to Web Service for Downloading/Streaming (Nerd Alert!)
Audiosyncrasy
12-02-2019, 11:55 AM
I assist the technical team at church with mixing and recording weekly events. For the past several years, we've recorded each event directly to a CD which is quickly duplicated and available for attendees to grab on their way out the door. In addition, we do a raw multi-track recording, using REAPER, which we can use to do a more detailed mix or pipe back through the console for training or critique.
We also have recordings available online, but this means someone has to rip the CD's back to an audio file and then publish them.
I'd like to bring us into the current age and automate the process of grabbing the files recorded via REAPER (on a Windows 7 system) and uploading them to a webpage to be available for streaming or download. Obviously, we wouldn't upload all of the recorded tracks, but we could configure a stereo track that contains everything we need.
I was initially thinking about writing a PowerShell script that would upload audio files into a filestore and a quick and dirty Node backend that would automatically detect changes to the filestore and serve up the audio files.
However, we have a very simple web hosting plan, and it doesn't allow us to install Node. Does anyone have any experience automating this process?
Lokasenna
12-02-2019, 12:38 PM
What sort of hosting is it? If it's just a server sharing whatever you put in folder X then the new files should be available as soon as they're uploaded.
mschnell
12-02-2019, 02:35 PM
I seem to remember that we had this discussion already several months ago ?!?!?
-Michael
karbomusic
12-02-2019, 02:40 PM
What sort of hosting is it? If it's just a server sharing whatever you put in folder X then the new files should be available as soon as they're uploaded.
Something has to enumerate and display those files via http on the server if it is automated which means back-end code. Browser FTP pages and directory browsing are insecure and outdated workarounds. They could potentially script the enumeration locally including appending the html page locally, then just uploading the files and the updated page. Sort of primitive but would work.
Lokasenna
12-02-2019, 03:24 PM
Something has to enumerate and display those files via http on the server if it is automated which means back-end code. Browser FTP pages and directory browsing are insecure and outdated workarounds. They could potentially script the enumeration locally including appending the html page locally, then just uploading the files and the updated page. Sort of primitive but would work.
You say "primitive", I say "perfectly sensible for a static host".
karbomusic
12-02-2019, 03:27 PM
You say "primitive", I say "perfectly sensible for a static host".
Uploading to the site as the admin is marginally OK (should still be SFTP at minumum) but having end users use it aka directory browsing etc, that's a terribly primitive, insecure, windows 98 way of doing things. I didn't opine that point, it's really the case and most browsers deny doing some of it these days for that reason. It would be much better to script it locally and just upload the updated page and files so the users see the same HTML page but updated.
One reason I made that suggestion is because the OP mentioned powershell and if they can script powershell, they can do this easily.
Lokasenna
12-02-2019, 03:33 PM
Sorry, that's what I thought you meant - whoever's uploading the files should be uploading a new index. That's how static sites are supposed to work.
karbomusic
12-02-2019, 03:36 PM
Sorry, that's what I thought you meant - whoever's uploading the files should be uploading a new index. That's how static sites are supposed to work.
Got it, makes sense - the files gotta get there somehow. :D
Audiosyncrasy
12-03-2019, 03:15 PM
Thanks for the suggestions! Treating it as a static upload and updating the index locally sounds like a sensible solution. I would of course prefer to have the more elegant solution with a dynamic backend watching for changes, but this will probably do the trick for a static host.
Sounds like I’ll be spending some time on StackOverflow and other Internet forums to research best-practices.
Audiosyncrasy
12-12-2019, 10:14 AM
Update: I have a working PowerShell script on my test machine. It's successfully uploading audio files and a JSON file, containing the date, title and url for the audio file.
The recording machine is Windows 7, so I need to update PowerShell to v5.1 before I implement the solution. Then, I'll need to get REAPER recording to the correct directory. Finally, I'll need to schedule the script to be run once per week.
Eventually, I'll need to update the script to more elegantly handle file uploads. Right now, it's simply overwriting the directory containing the audio files on the server, which is clunky at best.
karbomusic
12-12-2019, 10:19 AM
Glad it's moving along. :)
vBulletin® v3.8.11, Copyright ©2000-2025, vBulletin Solutions Inc.