• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
upload problem

#1
[eluser]timaksu[/eluser]
so i went ahead and followed this http://ellislab.com/codeigniter/user-gui...ading.html and got uploading to work. its nice and easy. gotta love CI lol. problem is, i cant access my images when i navigate to localhost/codeigniter/uploads/imagename.gif

im guessing this is because i have the rewrite stuff happening (remove index.php), and its trying to access the uploads controller?

well how do i access the images then?

#2
[eluser]Dam1an[/eluser]
You'd have to build a controller with a view function which takes the name of the image as an argument
You ould then pass this to your view which would use the standard HTML img tag to display it

#3
[eluser]timaksu[/eluser]
can you quickly help me get that working? what would that look like? i know the constructor will be need to be called 'uploads' but what about the functions? wouldnt going to an image (say, image.gif) call the image.gif funtion in the uploads constructor?

#4
[eluser]pistolPete[/eluser]
[quote author="tidus97" date="1240702866"] cant access my images when i navigate to localhost/codeigniter/uploads/imagename.gif
im guessing this is because i have the rewrite stuff happening (remove index.php)[/quote]
Please post your .htaccess file.
You probably need something like this:
Code:
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d

#5
[eluser]timaksu[/eluser]
Code:
RewriteEngine on
RewriteRule ^$ /codeigniter/index.php [L]

RewriteCond $1 !^(index\.php|images|css|js|robots\.txt|favicon\.ico)

RewriteRule ^(.*)$ /codeigniter/index.php/$1 [L]

#6
[eluser]timaksu[/eluser]
sorry but bump?

#7
[eluser]TheFuzzy0ne[/eluser]
You'r htaccess file should be in the same directory as your index.php.

Code:
RewriteEngine on

RewriteCond %{REQUEST_URI} !^(index\.php|images|css|js|robots\.txt|favicon\.ico)
RewriteRule ^(.*)$ index.php/$1 [L]

#8
[eluser]timaksu[/eluser]
that doesnt work.. >_<


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.