Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6953449
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T14:28:49+00:00 2026-05-27T14:28:49+00:00

I have created an uploads folder in the CodeIgniter root, that accepts all the

  • 0

I have created an uploads folder in the CodeIgniter root, that accepts all the uploaded images from the form. Then the upload path is sent to the database. Later i retrieve all the information from the database in a view page. I am trying to get all the images to display on the view page that are uploaded, but the upload path is adding too much to the URL.

the upload config looks like this:

$config = array(
        'upload_path'   => './uploads/',
        'allowed_types' => 'gif|jpg|png',
        'max_size'  => '6000',
        'max_width' => '2068',
        'max_height'    => '1032',
        'encrypt_name'  => true,
);

and the view page looks like this:

                                             <tr>                
                                                 <td><img src="<?php echo $pet->filepath?          
                                                     >" alt="pet photo"></img><br/></td>
                                                    <td><?php echo $pet->pet_name?><br/>      
                   </td>
                                                    <td><?php echo $pet->species."      "; 
               ?></td>
                                                    <td><?php echo $pet->breed; ?></td>
                                                    <td><?php echo $pet->gender; ?></td>
                                                    <td><?php echo $pet->color; ?></td>
                                                    <td><?php echo $pet->comments; ?></td>


                                            </tr>

                                    <?php endforeach; ?>

when i check the image URL when i test the view it shows up as:
CodeIgniter_2.1.0/CodeIgniter_2.1.0/index.php/upload/uploads/beagle.jpg

but it needs to be:
CodeIgniter_2.1.0/CodeIgniter_2.1.0/uploads/beagle.jpg

does anyone know how to change this??

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T14:28:50+00:00Added an answer on May 27, 2026 at 2:28 pm

    There is an easy to follow tutorial here that explains how to create a URL rewrite that removes the index.php. You could edit it to be something like this (not tested):

    RewriteEngine on
    RewriteCond $1 !^CodeIgniter_2.1.0/CodeIgniter_2.1.0/(index\.php|uploads.*|robots\.txt).*$
    RewriteRule ^(.*)$ ^CodeIgniter_2.1.0/CodeIgniter_2.1.0/index.php/$1 [L]
    

    Then you should (again, not tested), be able to access the image at CodeIgniter_2.1.0/CodeIgniter_2.1.0/uploads/beagle.jpg

    EDIT: woops, misunderstood the question, you want CodeIgniter_2.1.0/CodeIgniter_2.1.0/index.php/upload/uploads/beagle.jpg -> CodeIgniter_2.1.0/CodeIgniter_2.1.0/uploads/beagle.jpg right?

    In that case, give this a shot:

    RewriteEngine on
    RewriteRule ^.*/index.php/upload/uploads(.*)$ /CodeIgniter_2.1.0/CodeIgniter_2.1.0/uploads$1 [L]
    

    This says any url that contains /index.php/upload/uploads should redirect to /CodeIgniter_2.1.0/CodeIgniter_2.1.0/uploads/whatever

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an upload form where users can upload images that are currently being
I have created a form that allows users to upload an image to a
I have created a Visual Studio 2008 sp1 test suite web test that uploads
I have created a program which allows me to upload images to my server.
We have created a web application, using ASP.NET, that allows users to upload documents
i've created a folder in my c drive (c:/artwork) that im using to upload
I have an ASP.net website that will allow users to upload images using a
i have created a photography website with an admin page that uploads photos to
I have a php file that uploads images like jpegs and png onto a
I have created a web application in that application i have added two folder.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.