I'm using PHP to retrieve some Base64 data, decode it and write it to a file, my code works fine. However, the owner is apache and the permissions are very low, so even if I FTP into the area where it's uploaded, i cannot download the file. However do i change the permission and owner so i have more control over the file? Here is my code
$path = "uploads/";
$filename = time().".png";
$full_path = $path.$filename;
$image_encoded = $_POST['image'];
$image_decoded = base64_decode($image_encoded);
$handle = fopen($full_path, 'x+');
fwrite($handle, $image_decoded);
fclose($handle);