I'm writing a script that requires the upload of files. I keep running into a host of problems having to do with safe mode. After searching through the archives on here, I came up with the following:
$dirpath = "home/2036110209/www/web/modules";
$tmp_name = $HTTP_POST_FILES['story']['tmp_name'];
move_uploaded_file ($tmp_name, "$dirpath/$ModName/stories/$author/");
chmod("/$dirpath/$ModName/stories/$author/", 0644);
The problem is, I get the following error:
Warning: chmod failed: Operation not permitted in /home/2036110209/www/web/modules/Fanfiction/index.php on line 349
(yes, $ModName and $author are defined elsewhere; that's not the problem)
I'm about to start tearing my hair out. Actually, what I really need is a way to upload the file and create the directory it goes into at the same time; but right now I'd be happy if the darn thing would just upload! Any suggestions?