sublok Posted April 16, 2015 Share Posted April 16, 2015 (edited) On a Godaddy VPS. having an issue with the downloads controller. File is properly set in the product. I ssh'd into the server and its showing the u:g as apache:apache, its not creating a Symlink for the file, so file_exists returns false, due to server restrictions, chown and chmod have been disabled and I require safe_mode for security reasons. and I cant do direct fallback for readfile because the output of the file being downloaded outputs a custom formatted PDF, which vars are being passed in the redirect. I can get it to echo out error messages, if (DOWNLOAD_BY_REDIRECT == 'true') { // This will work only on Unix/Linux hosts tep_unlink_temp_dir(DIR_FS_DOWNLOAD_PUBLIC); $tempdir = tep_random_name(); umask(0000); //works making hidden dir mkdir(DIR_FS_DOWNLOAD_PUBLIC . $tempdir, 0777); //not working symlink(DIR_FS_DOWNLOAD . $downloads['orders_products_filename'], DIR_FS_DOWNLOAD_PUBLIC . $tempdir . '/' . $downloads['orders_products_filename']); if (file_exists(DIR_FS_DOWNLOAD_PUBLIC . $tempdir . '/' . $downloads['orders_products_filename'])) { tep_redirect(tep_href_link(DIR_WS_DOWNLOAD_PUBLIC . $tempdir . '/' . $downloads['orders_products_filename'], 'id='.$customer_id .'&token='. $token. '&oToken='. $tokenOrder. '&pid=' .$downloads['pid'])); // }else{ echo "no file found"; } } ideas? Edited April 16, 2015 by sublok Quote Link to comment Share on other sites More sharing options...
sublok Posted April 17, 2015 Author Share Posted April 17, 2015 (edited) As a follow up echo '<pre>'; var_dump(exec('whoami')); echo "Current Script Owner: ".get_current_user()."\n"; outputs string(6) "apache"Current Script Owner: {username} different that "apache" It appears that Symlink needs to have the same permissions to create a link, Im not sure how to make that happen, So i know its now a permissions issue, does anyone know how to assist? Edited April 17, 2015 by sublok 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.