http://www.perlmonks.org?node_id=839032

jonnyfolk has asked for the wisdom of the Perl Monks concerning the following question:

I've written a script which updates a data file then prints a web page with an embedded sound file. However it seems that the iphone won't directly play an embedded sound file.

I'm wondering if I call the sound file directly how I might generate the change to the data file as the sound file is accessed. Perhaps I could use .htaccess?

I'd br grateful for any ideas

Replies are listed 'Best First'.
Re: [OT] Update data file on accessing sound file
by amedico (Sexton) on May 09, 2010 at 17:28 UTC
    You could serve the sound file through a CGI script (e.g. "http://myserver/cgi-bin/getfile.pl?file=sound.mp3") and have the script increment some persistent counter every time it serves the file.
Re: (no longer [OT]) Update data file on accessing sound file
by ww (Archbishop) on May 09, 2010 at 21:54 UTC
    Yup, gotta' agree with amedico!

    Forget embedding.

    Put the music file on the server, use cgi to start it playing and to "generate the change to the data file...."

    And now a question back: is this "change to the data file" something more complex than incrementing a counter and perhaps tracking user info (like IP, browser, etc)?

Re: [OT] Update data file on accessing sound file
by Anonymous Monk on May 08, 2010 at 17:04 UTC
    I'd br grateful for any ideas

    Take it to an iphone forum, thanks ;)

      If it was a question about the iphone that would indeed be a good thing to do. However it's a question about updating files on a server, of which there is much expertise on this forum...

        iphone won't directly play an embedded sound file.

        Iphone is a kind of server?