I have developed a website to upload and display images. And it works fine on the local server , but when I upload it to the web server it wont show the image. But the file has been uploaded to the current location in the server and the path is also fine.
2
-
The first thing to do is check the source of your generated HTML, copy the URL for the image and see if it's really doing what you expect when you post it into the browser.Brian Hoover– Brian Hoover2011-12-25 16:06:44 +00:00Commented Dec 25, 2011 at 16:06
-
Are the file uploaded? Have you checked the file/folders permissions?Zar– Zar2011-12-25 16:07:23 +00:00Commented Dec 25, 2011 at 16:07
Add a comment
|
2 Answers
I'd suggest you the full path in the url, literally type it out. If that does not work, check that the file is readable by setting the permissions of the image file.
1 Comment
nand
chmod 0755 image.png, additionally you might want to set ownership with chown user:group image.pngI think you may have problem with their format. Check your scripts and make sure their formats to be as same as your local files. If you have a programming mistake, files will save on the server, but their formats may not be actual.
I had this problem before ...
6 Comments
doubleD
This how i give to display the images <img src="uploads/',$vehic['id'],'/',$vehic['image_id'],'.',$vehic['image_ext'],'" width="160" height="120" alt="" />
doubleD
and this is how the it reads after da values <img src="uploads/22/16.jpg" width="480" height="360" alt="">
Ben D
Are you trying to use a comma as a concatenator? Try using a period to join strings. What does the outputted HTML look like?
Ben D
what directory are you in when the image is included? This html will only load the image if you're in the web root. Assuming that the uploads folder is in the web root, try changing the html to <img src="/uploads/22/16.jpg" width="480" height="360" alt=""> (leading slash)
doubleD
it also did not worked i try with <img src="/uploads/22/16.jpg" width="480" height="360" alt=""> html tag also
|