I am uploading files to a directory succesfully, however, I cannot read them as the permisins won't let me. Of course I can go in to the file and alter the permisions but I want this to be done automatically. I thought if I altered the Main directory setting that it would work for all the files I put in it but it doesn't.
I have two files
1) form_uploadpi.inc
<form enctype="multipart/form-data"
action="uploadpi2.php" method="POST" ">
<input type="hidden" name="MAX_FILE_SIZE" value="750000" >
<input type="file" name="pix" size="60">
<input type="hidden" name="AssCode" value="<?php echo $AssCode?>">
<p><input type="submit" name="Upload"
value="Upload invoice">
</form>
2) uploadpi2
$destination = '/home/precs/PI/'.$_FILES['pix']['name'];
$temp_file = $_FILES['pix']['tmp_name'];
move_uploaded_file($temp_file,$destination);
echo "<p><b>The file has successfully uploaded:</b>
{$_FILES['pix']['name']}
({$_FILES['pix']['size']})</p>";
When I do the upload is there anything I can add that automatically changes the permisions.
Cheers