Welcome Guest, Not a member yet? Register   Sign In
Image Path
#1

[eluser]j4zzyh4ck3r[/eluser]
I have folder assets(images, scripts, styles) under application folder at the same level with mvc folders, how can I access images/1.jpg in my view, because when I used "./assets/images/1.jpg" it failed (the image broken). thanks in advance Smile
#2

[eluser]InsiteFX[/eluser]
Move it out of the application folder!

InsiteFX
#3

[eluser]j4zzyh4ck3r[/eluser]
[quote author="InsiteFX" date="1302254639"]Move it out of the application folder!

InsiteFX[/quote]

Is that possible to use it inside application folder ? Or is it against the rules to put it inside application folder ? Thanks Smile
#4

[eluser]toopay[/eluser]
Put it same level with 'application' and 'system', then you can do this way
#5

[eluser]j4zzyh4ck3r[/eluser]
[quote author="toopay" date="1302261764"]Put it same level with 'application' and 'system', then you can do this way[/quote]

Sorry, it didn't work, when I see the source, it like this
Code:
<img src="http://localhost:8088/CodeIgniter_2.0.1/index.php/images/1.jpg" width="640" height="480" title="Zaraki Kenpachi" alt="1.jpg" />

I use just folder images inside application folder with same level with mvc folders and 1.jpg is inside images folder... Thanks Smile
#6

[eluser]toopay[/eluser]
Unbelievable. How its possible, the 'assets' fragment dissapear, when you put this line
Code:
//Notice that this is should be generated something like [your site relative url]/assets/images/1.jpeg
<img src="&lt;?php echo site_url('assets/images/1.jpeg') ?&gt;" alt="filename" title="caption" />
We can fix 'index.php' later, but first, there are something wrong with your result!
#7

[eluser]j4zzyh4ck3r[/eluser]
[quote author="toopay" date="1302277415"]Unbelievable. How its possible, the 'assets' fragment dissapear, when you put this line
Code:
//Notice that this is should be generated something like [your site relative url]/assets/images/1.jpeg
<img src="&lt;?php echo site_url('assets/images/1.jpeg') ?&gt;" alt="filename" title="caption" />
We can fix 'index.php' later, but first, there are something wrong with your result![/quote]

I already changed the folder so there is no assets folder anymore, I changed into folder images, so the path is application/images/1.jpg
#8

[eluser]toopay[/eluser]
Then, you just need to remove index.php from your url...
#9

[eluser]j4zzyh4ck3r[/eluser]
[quote author="toopay" date="1302292466"]Then, you just need to remove index.php from your url...[/quote]

Do u mean like this ? http://localhost:8888/CodeIgniter_2.0.1/images/1.jpg, it still didn't work Sad
#10

[eluser]toopay[/eluser]
You need to MOVE your assets folder OUT from your application folder. Your directory structure should be something like this...

--- assets(or images or whatever)
|- application
|- system

You should can access '1.jpg' with 'http://localhost:8888/CodeIgniter_2.0.1/images/1.jpg' not 'http://localhost:8888/CodeIgniter_2.0.1/application/images/1.jpg'




Theme © iAndrew 2016 - Forum software by © MyBB