• Resolved auan

    (@auan)


    Hey all,

    I have a page on this blog that has files, uploaded through a file uploader plugin in wordpress. When one tries to access the files to download I receive this error:

    Forbidden

    You don’t have permission to access /upload_files/resources/Evalue Research_Challenges To Implementing Good Practice.pdf on this server.

    Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.

    Apache/2.2.11 (Unix) mod_ssl/2.2.11 OpenSSL/0.9.8e-fips-rhel5 mod_auth_passthrough/2.1 mod_bwlimited/1.4 FrontPage/5.0.2.2635 PHP/5.2.9 mod_wsgi/2.5 Python/2.4.3 Server at https://www.evalueresearch.co.nz Port 80

    The php for the resources page is pretty self explanatory as it gets a list of files from a certain dir on the server and displays them in <h4> tags and their descriptions in <p> tags. Even with all of this making sense it seems that the files
    are not found on the server/one does not had permission to download/view them?

    <?php
    /**
     * Template Name:resources
     */
    if (false){
    ?>
    <link href="style.css" rel="stylesheet" type="text/css" />
    <?php } ?>
    <?php include("includes/head.php"); ?>
    <body>
    <div id="page">
    	<?php include("includes/header.php");?>
    	<div id="leftcol">
    	  <div id="main">
                <div class="content">
                    <?php the_post();
    				$content = get_the_content();
    				$content = apply_filters('the_content', $content);
    				$content = str_replace('<br />','</p><p>',$content);
    				echo $content;
    				?>
    			</div>
    			<div class="resources">
                	<?php
    				//resources
                    global $wpdb;
                    $select_files = "SELECT * FROM ".$wpdb->prefix."files ORDER BY file_name ASC";
    				$result_files = $wpdb->get_results($select_files);
                    foreach($result_files as $files){ ?>
                        <h4><a href="/upload_files/resources/<?php echo($files->file_name); ?>"><?php echo($files->display_name); ?></a></h4>
                        <p><?php echo($files->description); ?></p>
                    <?php } ?>
                    <?php if (sizeof($result_files) == 0){?>
    					<p>
    						Im sorry to say that there is currently no resources :(
                        </p>
                        <p>
                        	please check back shortly.
                        </p>
    				<?php } ?>
                    </div>
            <div class="rsource_clr"></div>
                    </div>
    	</div>
            <?php include("includes/sidebar.php"); ?>
        <?php include("includes/footer.php"); ?>
    </div>		<?php //end of page ?>
    </body>
    </html>

    Cheers for any help.

Viewing 1 replies (of 1 total)
  • Thread Starter auan

    (@auan)

    Solved. All that needed to be done was change file permissions of “upload_files” to 0775.

    Thanks

Viewing 1 replies (of 1 total)
  • The topic ‘Forbidden 404 when downloading files from blog’ is closed to new replies.