I have a small script that I am try to port to work for serving video data to the iPhone/Blackberry/PalmPre etc.
The code is ridiculously simple:
$type = "video/3gpp"; /* get mimetype from db */
$fileid = "0001"; /* File path from db */
header( "Content-Length: " . filesize( $fileId ) );
header( "Content-type: $type" );
readfile( $fileId );
It simply get's a file id based on arguments and uses readfile to send the file down to the requester.
However for some odd reason it only works once. If you try to access the page two times in a row on both the iPhone and BlackBerry it will work the first time. Then either any time after it will either time out or just stop responding to the request. This behavior is not the same on a non-mobile device, it works fine in Firefox/Safari/Chrome. I am fairly certain It has nothing to do with caching either on the non-mobile side.
Any Idea's why this might happen?