My /albums/edit folder is being deleted every now and then.
And getting frustrated with it, I decided to modify the following codes in upload.php
upload.php, find
function spring_cleaning($directory_path) {
//First we get the transitory directory handle.
$directory_handle = opendir($directory_path);
// Exit if the directory cannot be opened.
if(!$directory_handle) {
// Return.
return;
}
replace with
function spring_cleaning($directory_path) {
//First we get the transitory directory handle.
$directory_handle = @opendir($directory_path);
// Exit if the directory cannot be opened.
if(!$directory_handle) {
// Return.
mkdir($directory_path, 0777);
return;
}
this codes simply creates the edit folder if it cannot be opened
use this at your own risks and preference
Actually, you should use the albums path that's in the config settings instead of hardcoding it. Like this:
global $CONFIG;
mkdir('.' . $CONFIG['fullpath'] . 'edit', 0777);
true enough
or perhaps I should use $directory_path instead
btw, have the dev team already know what causes the edit folder to be deleted ?
Ok, so what's the fix for this?
as suggested (just summarizing the previous posts up): edit upload.php, findfunction spring_cleaning($directory_path) {
//First we get the transitory directory handle.
$directory_handle = opendir($directory_path);
// Exit if the directory cannot be opened.
if(!$directory_handle) {
// Return.
return;
}
and replace withfunction spring_cleaning($directory_path) {
global $CONFIG;
//First we get the transitory directory handle.
$directory_handle = @opendir($directory_path);
// Exit if the directory cannot be opened.
if(!$directory_handle) {
mkdir('.' . $CONFIG['fullpath'] . 'edit', 0777);
// Return.
return;
}
This is a quick-and-dirty fix - wouldn't mind if I were you though, it won't break anything.
Joachim
Hey guys,
I'm assuming the above problem relates to me. I've noticed that my 'edit' directory keeps losing it's permissions (from 755 to 666). I think this is because it's getting deleted as well. I changed the code in the 'pload.php' but it's not adding the 777 permissions and I get the following error:
Warning: mkdir(.albums/edit): No such file or directory in /c59/ewiddel/gallery/upload.php on line 402
I did a search on the above errors with different variations, but found thing.
Any ideas guys? In the mean time, I'll call my Web hosting company to have them change the permissions to 755 again. Thanks in advance.
Open your include/picmgmt.inc.php file, and find and change '0666' to '0755'.
I changed the 0666 to 0755 on the include/picmgmt.inc.php file and that didn't seem to work. I verified that the Albums, Albums/userpics, and albums/edit folders are set to 755.
I still get Warning: mkdir(.albums/edit): No such file or directory in /c59/ewiddle/gallery/upload.php on line 402 when I click on the upload link and the following when I actually try and upload a picture (the same symptoms that everyone gets when the 'edit' folder isn't set to 755 although mine is. Any ideas?
Warning: move_uploaded_file(./edit/mHTTP_temp_2995890e.jpg): failed to open stream: No such file or directory in /c59/ewiddle/gallery/upload.php on line 1155
Warning: move_uploaded_file(): Unable to move '/tmp/phpkkemiK' to './edit/mHTTP_temp_2995890e.jpg' in /c59/ewiddle/gallery/upload.php on line 1155