Flash file upload and permissions

Does anyone know how to set permissions using php w/ a flash file upload system? The following is the base script I’m starting with (from a friends of ed book)

Thanks!


<?php

//path to storage
$storage = './uploadedFiles';

//path name of file for storage
$uploadfile = "$storage/" . basename( $_FILES['Filedata']['name'] );

//if the file is moved successfully
if ( move_uploaded_file( $_FILES['Filedata']['tmp_name'] , $uploadfile ) ) {
	echo( '1 ' . $_FILES['Filedata']['name']);

//file failed to move
}else{
	echo( '0');
}

?>

you have to use an FTP program or even dreamweaver can do it, theres no way to set permissions using PHP

thanks for the tip!

you CAN change permissions of the files with PHP, use chmod command, more help here : http://us2.php.net/manual/en/function.chmod.php

Cool thanks for that - I found out that my perm issues are based on our host. I’ve been playing w/ the chmod methods, though, I think they may be restricted by our host.

almost all hosts run “safe mode”. That’s why i said it wsn’t possible, its not good practise. But if you were running on your own server, you could do that. Also if you have a dedicated server, they may let you set “safe mode” off aswell.