0

Hello,
I have created a webpage where I use a simple command line tool [oggz-tool] to cut a section of the video. It works fine but the only problem is that when the new file is created, it is owned by www-data and not by the user I created which is history. How can I change this default ownership of the new file without doing it manually everytime?

I have searched and tried various commands like umask and setid but nothing that works for files created through the webpage. Any help would be nice. Thanks.

Here,s the code.

<html>
  <body>
		
<?php
		$s = 10;
		$e = 55;

		
		system('oggz-chop --start $s --end $e elephant.ogv -o section.ogv',$returnval);
		
		
?>

		<video src="section.ogv" width="800" height="600" controls>
		</video>
		
  </body>
</html>

So I am talking about the output file section.ogv which doesnt get the right permissions.

2
Contributors
3
Replies
4
Views
6 Years
Discussion Span
Last Post by kyoonn
0

The file is set to the account that creates the file which is normal. Changing the owner is probably not necessary but altering the file permissions to allow the file to be executed is.

Maybe something like this?

<?php
	$s = 10;
	$e = 55;
	
	system('oggz-chop --start $s --end $e elephant.ogv -o section.ogv',$returnval);
	chmod("section.ogv", 0755);
?>

Edited by pixelsoul: n/a

0

The file is set to the account that creates the file which is normal. Changing the owner is probably not necessary but altering the file permissions to allow the file to be executed is.

Maybe something like this?

<?php
	$s = 10;
	$e = 55;
	
	system('oggz-chop --start $s --end $e elephant.ogv -o section.ogv',$returnval);
	chmod("section.ogv", 0755);
?>

I tried that but no luck ... the only way it seems to work is if I do : sudo chown history section.ogv but I have to do that manually on the server.

0

Can anybody help?!? I am still trying to figure this out.... I also tried using umask through my php script but that did not make any difference.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.