Through the imap_* functions of php i'm trying to store the attachments of the emails on my server. I want to store the contents ($c, string) of the file with filename($f) in a sub-directory named with a thread id ($thread). m_attpath is a defined constant pointing absolute to the base folder.
if(!is_dir(m_attpath.$thread)){
mkdir(m_attpath.$thread);
};
$handle = fopen(m_attpath.$thread.'/'.$f, 'w+');
fwrite($handle, $c);
fclose($handle);
But now i'm struggeling with the permissions i need to set in order to let the attachements viewable through an download.php page.
the main folder m_attpath = 0777 the thread folder is 0644 the files them self are also 0644
When viewing the files through my browser they end up as an question mark. The browser doesn;t display an 404 warning. In an ftp programm i can see the size of the attachments. Something is wrong, but i cant find what. Can anyone help me with this?
thanx