Dragen Posted June 26, 2007 Share Posted June 26, 2007 Hi, I've got my script which checks if a directory exists, if not creates it. It seems to be working fine. I create the directory and upload a file to it and can then view the file on the server through my browser. Now the problem starts when I look at it with any ftp client. For some reason I can't see the created directories or files. In my directory I should have something such as: root/images/products/clothing/tops/myfile.gif But I can only view up to products (which looks empty). Products is a directory created at the same time as the invisible directories/files, so it's confusing me... anyway, here's my code: <?php if (is_dir(DIR_FS_CATALOG_IMAGES . DIR_FS_PRODUCTS_IMAGES . $catdir)) { if (!is_writeable(DIR_FS_CATALOG_IMAGES . DIR_FS_PRODUCTS_IMAGES . $catdir)) $messageStack->add(ERROR_CATALOG_PRODUCT_IMAGE_DIRECTORY_NOT_WRITEABLE, 'error'); } else { mkdir(DIR_FS_CATALOG_IMAGES . DIR_FS_PRODUCTS_IMAGES . $catdir, 0700); } ?> am I using the mkdir wrong? I haven't used it before, but I don't see a problem with it. Thanks Quote Link to comment Share on other sites More sharing options...
trq Posted June 26, 2007 Share Posted June 26, 2007 Its pretty hard to tell whats going on with all the constants, but it looks ok. Have you tried creating a test dir? eg; <?php mkdir("root/images/products/test",0700); ?> Just to see if you can see it. Quote Link to comment Share on other sites More sharing options...
redarrow Posted June 26, 2007 Share Posted June 26, 2007 try this <?php if (is_dir(DIR_FS_CATALOG_IMAGES . DIR_FS_PRODUCTS_IMAGES . $catdir)) { if (!is_writeable(DIR_FS_CATALOG_IMAGES . DIR_FS_PRODUCTS_IMAGES . $catdir)) $messageStack->add(ERROR_CATALOG_PRODUCT_IMAGE_DIRECTORY_NOT_WRITEABLE, 'error'); } else { mkdir(DIR_FS_CATALOG_IMAGES . DIR_FS_PRODUCTS_IMAGES . "$catdir", 0700); } ?> Quote Link to comment Share on other sites More sharing options...
Dragen Posted June 26, 2007 Author Share Posted June 26, 2007 thanks for the suggestions.. I'm not quite sure what putting the variable between quotes would do. I testing creating a different directory and it works fine, it's just when I use the code above. My host say that the ownership settings may have been set up incorrectly. I have no idea what that means or how to change them, but they seemed to suggest that I couldn't, which makes me wonder how they could be set up incorrectly if I can't do anything to them :-\ Quote Link to comment Share on other sites More sharing options...
per1os Posted June 26, 2007 Share Posted June 26, 2007 You chould try chmod'ing the DIR after creation. The 0700 part may be holding you up, try 0777 just for a test measure. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.