loki421
asked on
Can't seem to pull image source from database?????
Hi all!
I can't see what's going wrong here people, i have a MySQL data base that stores the name of the image while the image is stored in a temp folder on the server. The problem is when i try to display the data on a dynamic page (made in DW CS3), it doesn't show the image. So what's going wrong? I have several text feilds that all display fine, but the image won't display????
Anybody have any experiance with displaying dynamic images on the web??? I'd really like to hear from you if you do :-)
Many thanks in advance guys & gals!
I can't see what's going wrong here people, i have a MySQL data base that stores the name of the image while the image is stored in a temp folder on the server. The problem is when i try to display the data on a dynamic page (made in DW CS3), it doesn't show the image. So what's going wrong? I have several text feilds that all display fine, but the image won't display????
Anybody have any experiance with displaying dynamic images on the web??? I'd really like to hear from you if you do :-)
Many thanks in advance guys & gals!
<cfoutput query="rsCars">
<table width="268" border="0">
<tr>
<td width="262"><p class="style3"> </p>
<p> </p></td>
</tr>
<tr>
<td><div align="left"><img src="temp/#rsCars.image#" alt="car" width="100" /><span class="style3">#rsCars.vehicle_description#</span></div></td>
</tr>
<tr>
<td nowrap="nowrap">Business Price: <span class="style3">#rsCars.business_price#</span></td>
</tr>
<tr>
<td nowrap="nowrap">Personal Price: <span class="style3">#rsCars.personal_price#</span></td>
</tr>
</table>
</cfoutput>
ASKER
Yep, it can 'see' the image fine, it displays the name of it ok. And i can browse to the folder and see the images myself. This is still in the development phase at the moment and i'm running it all locally on my laptop, don't know if that'll make any difference?
Here's a screenshot of the data...
screenshot.jpg
Here's a screenshot of the data...
screenshot.jpg
ASKER
Oh, and here's a screen shot of how it displays....
screenshot2.jpg
screenshot2.jpg
Looks like your doing it right and the path is just wrong to the image.
Are your images really located in a temp directory under the webroot
can you browse to one
http://www.yourdomain.com/temp/fiat.jpg
Are your images really located in a temp directory under the webroot
can you browse to one
http://www.yourdomain.com/temp/fiat.jpg
I think that temp isn't located under the webroot.
ASKER
Here's the path of the temp folder: C:\ColdFusion8\wwwroot\new _site_deve lopment\te mp (it's all hosted locally at the moment and not live).
This is where the images are stored. In the admin site, the name of the image goes to MySQL and then on the next page you upload the file to this directory. I double check the db to confirm that the image name is in there correctly, and then use temp/#rsCars# to try and display them, but it's just not working, would there be something i'm missing somewhere? Maybe on the CF server? Or on one of the pages somewhere? I'm really scratching my head here! :-(
You got any ideas? :-)
This is where the images are stored. In the admin site, the name of the image goes to MySQL and then on the next page you upload the file to this directory. I double check the db to confirm that the image name is in there correctly, and then use temp/#rsCars# to try and display them, but it's just not working, would there be something i'm missing somewhere? Maybe on the CF server? Or on one of the pages somewhere? I'm really scratching my head here! :-(
You got any ideas? :-)
ASKER
Sorry, meant temp/#rsCars.image#
Can you browse to the image manually?
If so what is the url ie
http://localhost/new_site_development/temp/fiat.jpg
you could try the full url below
<img src="http://localhost/new_site_development/temp/#rsCars.image#" alt="car" width="100" />
If so what is the url ie
http://localhost/new_site_development/temp/fiat.jpg
you could try the full url below
<img src="http://localhost/new_site_development/temp/#rsCars.image#" alt="car" width="100" />
ASKER
Just tried both, and neither works!!! Fustrating isn't the word!! :-)
What am i missing?! just checked the images in the temp folder, they match exactly what it says in the db.
Would you like to see the whole code for the page?
What am i missing?! just checked the images in the temp folder, they match exactly what it says in the db.
Would you like to see the whole code for the page?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Ah ha!! Success!!! Might help to put the port in the address hey!!! lol :-)
All sorted now mate, thaks for all your help and time..... 500 point comin your way :-) :-)
Really appreciated :-)
All sorted now mate, thaks for all your help and time..... 500 point comin your way :-) :-)
Really appreciated :-)
ASKER
Thanks for your time pal, really helped :-)
glad you got it sorted.
ASKER
Yep! Me too, was starting to lose faith :-) Just need to figure out how to horizonaly loop the data now!! So will probably be back here in a couple of days :-)!!!
Take care :-)
Take care :-)
before the cfoutput
put a
<cfdump var="#rsCars#" />
To check that the url is indeed coming out of the query and pointing to the correct image path, also ensure you can browse to that path manually and see the image.