Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
Rename file each time it is saved
Old 07-24-2011, 05:27 PM Rename file each time it is saved
Extreme Talker

Posts: 218
Trades: 0
This script that I'm using, on a web page, allows a web page visitor to record a video, via his webcam. However, the recording is given the same file name each time (Video), thus each new recording replaces the previous stored one. How can I add code that will give each recording a unique file name - so that all recordings are saved/stored?

Code:
<!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=Video&rtmpPath=rtmp://67.xxx.xxx.xxx/vid/&finishURL=player.html')
               so.write("recorder");
               // ]]>
               </script>
</body>
</html>
chrisj is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 07-24-2011, 05:52 PM Re: Rename file each time it is saved
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,384
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
Add the date and time to the filename.
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 07-24-2011, 06:47 PM Re: Rename file each time it is saved
Extreme Talker

Posts: 218
Trades: 0
Thanks. That's a great idea.
I don't know how to do that.
Would anyone like to assist me with adding that ability to the html?
Much appreciated.
Thanks.
chrisj is offline
Reply With Quote
View Public Profile
 
Old 07-24-2011, 07:05 PM Re: Rename file each time it is saved
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,384
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
Can't be done in HTML, it will have to be in whatever PHP code names the file.
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 07-24-2011, 08:27 PM Re: Rename file each time it is saved
Extreme Talker

Posts: 218
Trades: 0
Thanks for that reply.
This script I purchased has no PHP files.
I was told I needed some php help to rename the video files,
that's why I posted here.

The purchased script comes with .as files, .js files, .swf files an .fla file, and two html files. The html code posted in this thread is the only thing that names the recorded files (as far as I can tell).

Would you be kind enough to tell me what I would need, at this point, to move forward to reach my ultimate goal of renaming the recorded files?
Would I need someone to write some php for this html file?

Thanks for enlightening me.
chrisj is offline
Reply With Quote
View Public Profile
 
Old 07-24-2011, 09:13 PM Re: Rename file each time it is saved
mgraphic's Avatar
Truth Seeker

Latest Blog Post:
JAMISONTUNES
Posts: 2,918
Name: Keith Marshall
Location: Connecticut
Trades: 0
Checkout tempnam()
__________________

<mgraphic /> - I don't have a solution but I admire the problem.
mgraphic is offline
Reply With Quote
View Public Profile
 
Old 07-25-2011, 03:00 PM Re: Rename file each time it is saved
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,384
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
Does this upload files to a server??
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 07-25-2011, 06:53 PM Re: Rename file each time it is saved
mgraphic's Avatar
Truth Seeker

Latest Blog Post:
JAMISONTUNES
Posts: 2,918
Name: Keith Marshall
Location: Connecticut
Trades: 0
Quote:
Originally Posted by chrishirst View Post
Does this upload files to a server??
No, it creates the file and returns the name. You could do a copy to move the contents.
__________________

<mgraphic /> - I don't have a solution but I admire the problem.
mgraphic is offline
Reply With Quote
View Public Profile
 
Old 07-25-2011, 11:17 PM Re: Rename file each time it is saved
Super Spam Talker

Posts: 879
Name: Paul W
Trades: 0
The Flash presumably offers an upload facility - you need a php script that it can invoke to do the file handling. Note: HTML and Javascript can't do this!
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE


*** New:
Please login or register to view this content. Registration is FREE
PaulW is offline
Reply With Quote
View Public Profile
 
Old 07-26-2011, 03:00 AM Re: Rename file each time it is saved
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,384
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
Quote:
Originally Posted by mgraphic View Post
No, it creates the file and returns the name. You could do a copy to move the contents.
That's what I surmised from the code and I was wondering why it was in the PHP board, so I thought I'd better ask if there was something that we were missing before giving a javascript code reply.
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 07-28-2011, 10:55 AM Re: Rename file each time it is saved
Physicsguy's Avatar
404 - Title not found

Posts: 920
Name: Scott Kaye
Location: Ontario
Trades: 0
You could try this when you're setting the name of the file:
PHP Code:
$name_of_file=str_replace(" ","_",$name_of_file."_".date("M_D_j_g:ia")); 
Which would give you something along the lines of My_recording_Jul_Thu_28_10:54am if the file name was 'My recording'.
__________________
Check out my
Please login or register to view this content. Registration is FREE
or my
Please login or register to view this content. Registration is FREE
!
Physicsguy is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Rename file each time it is saved
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.32969 seconds with 12 queries