Play Audio file in writable folder - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: CodeIgniter 4 (https://forum.codeigniter.com/forumdisplay.php?fid=28) +--- Forum: CodeIgniter 4 Support (https://forum.codeigniter.com/forumdisplay.php?fid=30) +--- Thread: Play Audio file in writable folder (/showthread.php?tid=79886) |
Play Audio file in writable folder - rafinhaa - 08-09-2021 Is it possible to play audio files that are inside the writable folder? Code: <audio controls=""> I have this code on the front end, but the audio doesn't play. Thank you all! RE: Play Audio file in writable folder - wuuyun - 08-09-2021 premise : the public is the webroot two ways 1, add new folder example 'uploads' in public/ . then upload files in it (public/uploads) 2, make the (your writable/uploads full path) softlink to public/uploads . then upload filed in (writable/uploads full path) RE: Play Audio file in writable folder - InsiteFX - 08-10-2021 Try this, not tested. Code: <audio controls=""> See if that will work for you. UPDATE: I found out that chrome and any web browsers using the chrome engine will give the error. What I did to get it to work was to play the audio files from my live server then it worked. Could be public_html or public depends on the server mine is public_html Code: <audio controls autoplay> Set audio folder permissions to 755 All have only read access owner has read/write/execute permissions. Worked like a charm. RE: Play Audio file in writable folder - rafinhaa - 08-10-2021 I tried as follows, but to no avail. moved files from writable to public/assets/audios PHP Code: <audio controls> base_url('assets/audios/'.$line["audiofile"]) print: http://cdr.local/assets/audios/2021/08/10/1628604444.32-FX0-atendimento-11h07m29s.WAV directly accessing the url in browser RE: Play Audio file in writable folder - paliz - 08-10-2021 Upload your file to public /upload You cannot read file from writable folder RE: Play Audio file in writable folder - rafinhaa - 08-10-2021 (08-10-2021, 08:13 AM)paliz Wrote: Upload your file to public /upload Yes! i moved files from folder writable to public/assets/audios I found the problem was the file's codec Code: Input File : 'public/assets/audios/2021/08/10/1628601745.4-FX0-atendimento-10:22:32.WAV' I did the test with another file and everything worked Code: Input File : 'public/assets/audios/2021/04/06/1617722381.169-221-20523678-12:19:41.wav' Thanks to everyone who helped! |