Wij hebben een leuk systeempje lopen, maar hebben 1 probleem.

Zodra je een plaatje upload via upload.php geeft hij automatisch de code 600 mee, ipv 644

Hoe en waar kun je die chmod code nou precies invoeren?
Na een geslaagde upload kun je in je PHP code dit doen:
<?php
chmod ('bestandsnaam', 0644);
?>
Bedankt Jan! maar, ik begrijp nog niet helemaal waar ik het nu moet plaatsen. Ik heb maar even wat tekst geknipt en geplakt :-)

if ($file_size <= $max_size) {

						if ($file_size <= $sec_db_av) {

							if (is_uploaded_file($_FILES['form_data']['tmp_name'])) {

								$temp_name = $_FILES['form_data']['tmp_name'];

								srand ((double) microtime() * 1000000);
								$sec_unique_id = substr(md5(rand()),0,4);

								$sec_img_name = $_SESSION['sess_admin_id'].'-'.$sec_unique_id.'.'.$sec_set_img_type;
								$sec_img_path = $_SERVER["DOCUMENT_ROOT"].'/_img/'.$sec_dir_img_map.'/'; 

								$lock = 1;

								while (($lock<1000)&&(file_exists($sec_img_path.$sec_img_name))) {
									srand ((double) microtime() * 1000000);
									$sec_unique_id = substr(md5(rand()),0,4);
									$sec_img_name = $_SESSION['sess_admin_id'].'-'.$sec_unique_id.'.'.$sec_set_img_type;
									$sec_img_path = $_SERVER["DOCUMENT_ROOT"].'/_img/'.$sec_dir_img_map.'/'; 
									$lock++;
								}

								$set_filename = $sec_img_name;

								$url_location = '_img/'.$sec_dir_img_map.'/'.$sec_img_name;

								$imagehw = GetImageSize($_FILES['form_data']['tmp_name']);
								$imagew =  $imagehw[0];
								$imageh = $imagehw[1];

								move_uploaded_file($temp_name,$sec_img_path.$sec_img_name);
In de onderste regel:
<?php
if (move_uploaded_file($temp_name,$sec_img_path.$sec_img_name)) {
chmod ($sec_img_path.$sec_img_name, 0466);
}
?>
Helaas maakt dit geen verschil, de image blijft hij wegschrijven onder code 600
Probleem is opgelost.



Harstikke bedankt Jan!!!!! :-)

Reageren