Chrisj Posted July 25, 2011 Share Posted July 25, 2011 I have purchased a script that allows a web page visitor to record via their web cam. When the user selects 'stop recording" he's automatically taken to the player page and can play the video named VideoZ. The Player page code is below. What code can I add that will rename the file name VideoZ and give the recording a unique file name upon the user selecting "Save"? <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"> <head> <title>check recorded video</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <script type="text/javascript" src="js/swfobject.js"></script> </head> <body bgcolor="#ffffff"> <div id="player"></div> <script type="text/javascript"> // <![CDATA[ var so = new SWFObject("player.swf", "player", "640", "480", "9", "#000000"); so.addParam('flashvars','file=VideoZ&streamer=rtmp://67.xxx.xxx.xxx/videos'); so.write("player"); // ]]> </script> </body> </html> Quote Link to comment https://forums.phpfreaks.com/topic/242699-renaming-the-file-upon-saving/ Share on other sites More sharing options...
phpSensei Posted July 25, 2011 Share Posted July 25, 2011 Well first of all this is the PHP section, and second you need to find where the file is being created in the first place, and then generate a random number or code for the user and pass it in the param. Quote Link to comment https://forums.phpfreaks.com/topic/242699-renaming-the-file-upon-saving/#findComment-1246582 Share on other sites More sharing options...
Chrisj Posted July 25, 2011 Author Share Posted July 25, 2011 Thanks for your reply. To reply to your "need to find where the file is being created", the file is being "created" in the html (below - index.html). the script names each recording with the file name "VideoZ". Each time a recording is made it is saved as VideoZ, therefore replacing the previous recording each time. I'd like to save all recordings, not just have the latest one replace the previous one. Do I need to add some php somewhere to accomplish giving each recording a unique name? Any help will be appreciated. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"> <head> <title>recorder</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <script type="text/javascript" src="js/swfobject.js"></script> </head> <body bgcolor="#ffffff"> <div id="recorder"></div> <script type="text/javascript"> // <![CDATA[ var so = new SWFObject("recorder.swf", "recorder", "620", "470", "9", "#000000"); so.addParam('flashvars','filename=VideoZ&rtmpPath=rtmp://67.xxx.xxx.xxx/vid/&finishURL=player.html') so.write("recorder"); // ]]> </script> </body> </html> Quote Link to comment https://forums.phpfreaks.com/topic/242699-renaming-the-file-upon-saving/#findComment-1246740 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.