I''ve this small test app where I''m saving a user profile picture in a subdirectory under "public" folder. Now when a user uploads a picture - a unique directory is created under his id and then his/her image is stored there. Now while retrieving the image I only get the path name and nothing else. How can I get the image shown in the browser...HELP PLEASE!!! -- Posted via http://www.ruby-forum.com/.
On Jul 31, 2006, at 12:22 PM, Mister Stylizedgeek wrote:> I''ve this small test app where I''m saving a user profile picture in a > subdirectory under "public" folder. Now when a user uploads a > picture - > a unique directory is created under his id and then his/her image is > stored there. Now while retrieving the image I only get the path name > and nothing else. How can I get the image shown in the browser...HELP > PLEASE!!!No need to shout. Have you first checked that the image is getting stored properly? Then check to see if you can browse straight to the image in your web browser. If both those work then you probably have an error in your image tag in your view. -Mat
Mat Schaffer wrote:> On Jul 31, 2006, at 12:22 PM, Mister Stylizedgeek wrote: > >> I''ve this small test app where I''m saving a user profile picture in a >> subdirectory under "public" folder. Now when a user uploads a >> picture - >> a unique directory is created under his id and then his/her image is >> stored there. Now while retrieving the image I only get the path name >> and nothing else. How can I get the image shown in the browser...HELP >> PLEASE!!! > > No need to shout. Have you first checked that the image is getting > stored properly? Then check to see if you can browse straight to the > image in your web browser. > > If both those work then you probably have an error in your image tag > in your view. > -MatI already checked, everything displays in the browser correctly when called direct. And as an FYI, I''m not SHOUTING! -- Posted via http://www.ruby-forum.com/.
On Jul 31, 2006, at 12:45 PM, Mister Stylizedgeek wrote:> Mat Schaffer wrote: >> On Jul 31, 2006, at 12:22 PM, Mister Stylizedgeek wrote: >> >>> I''ve this small test app where I''m saving a user profile picture >>> in a >>> subdirectory under "public" folder. Now when a user uploads a >>> picture - >>> a unique directory is created under his id and then his/her image is >>> stored there. Now while retrieving the image I only get the path >>> name >>> and nothing else. How can I get the image shown in the >>> browser...HELP >>> PLEASE!!! >> >> No need to shout. Have you first checked that the image is getting >> stored properly? Then check to see if you can browse straight to the >> image in your web browser. >> >> If both those work then you probably have an error in your image tag >> in your view. >> -Mat > > I already checked, everything displays in the browser correctly when > called direct. And as an FYI, I''m not SHOUTING!Dude, you like, totally were. There were even bangs involved. :) Anyway. Do view source on the HTML, the path to the file is probably wrong or the tag is malformed Are doing this under apache by any chance? I''ve had trouble with the "public" directory being in the wrong place when using apache previously. -Mat