clatms Posted August 18, 2009 Share Posted August 18, 2009 Hi I need help. When the Add to Cart button is clicked (OSC v2.2 RC2), it throws this error message: Warning: unlink(images/temp/.) [function.unlink]: Is a directory in /home/public_html/includes/application_top.php on line 380 Warning: Cannot modify header information - headers already sent by (output started at /home/public_html/includes/application_top.php:380) in /home/public_html/includes/functions/general.php on line 33 It's worked before (testing before I went live) but at some point I messed it up. I did make minor edits since going live. I restored all of the pre-live files, but I still get the error. The Option Type contribution worked pre-live so I'm pretty sure it's not the contribution - just looking for general troubleshooting help here. Thanks! So in the application_top.php file, line 380 is "unlink(TMP_DIR . $file);" (see context below). Any and all advice appreciated! // customer adds a product from the products page case 'add_product' : if (isset($HTTP_POST_VARS['products_id']) && is_numeric($HTTP_POST_VARS['products_id'])) { //BOF - Zappo - Option Types v2 - File uploading: Purge the Temporary Upload Dir $purgeDir = opendir(TMP_DIR) or die ('Could not open '.TMP_DIR); while ($file = readdir($purgeDir)) { if ($file != ('.htaccess') && filemtime(TMP_DIR . $file) < strtotime(OPTIONS_TYPE_PURGETIME)) { unlink(TMP_DIR . $file); // Delete file from server... tep_db_query("delete from " . TABLE_FILES_UPLOADED . " where files_uploaded_name = '" . $file . "'"); // Remove File's database entry.... } } closedir($purgeDir); //EOF - Zappo - Option Types v2 - File uploading: Purge the Temporary Upload Dir Quote Link to comment Share on other sites More sharing options...
germ Posted August 18, 2009 Share Posted August 18, 2009 You could change this: unlink(TMP_DIR . $file); // Delete file from server... To: if ( ! is_dir( TMP_DIR . $file) ) unlink(TMP_DIR . $file); // Delete file from server... I think that would work. BACKUP THE FILE BEFORE EDITING!!! Quote If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you. "Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice." - Me - "Headers already sent" - The definitive help "Cannot redeclare ..." - How to find/fix it SSL Implementation Help Like this post? "Like" it again over there > Link to comment Share on other sites More sharing options...
clatms Posted August 18, 2009 Author Share Posted August 18, 2009 You could change this: unlink(TMP_DIR . $file); // Delete file from server... To: if ( ! is_dir( TMP_DIR . $file) ) unlink(TMP_DIR . $file); // Delete file from server... I think that would work. BACKUP THE FILE BEFORE EDITING!!! Yay that worked! 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.