Uploaded image, but not showing

I have a reasonably fresh WordPress install on my Ubuntu Linux server and I uploaded an image to it for use in a blog post. I checked the path in WordPress settings and I checked the contents on the server:

$ ls -l /srv/www/wp-uploads/blog.linformatronics.nl/2013/01
total 320
-rw-rw-r-- 1 www-data www-data 22033 Jan 19 10:23 ccs5licence1-150x150.png
-rw-rw-r-- 1 www-data www-data 64195 Jan 19 10:23 ccs5licence1-300x214.png
-rw-rw-r-- 1 www-data www-data 22033 Jan 19 10:19 ccs5licence-150x150.png
-rw-rw-r-- 1 www-data www-data 71973 Jan 19 10:23 ccs5licence1.png
-rw-rw-r-- 1 www-data www-data 64195 Jan 19 10:19 ccs5licence-300x214.png
-rw-rw-r-- 1 www-data www-data 71973 Jan 19 10:19 ccs5licence.png

The files are actually uploaded through WordPress, so it has write access to the filesystem/directory.

Read More

But when I try to use it in a blog post it shows a broken image and when I point the webbrowser directly to the image it throws an error 404 page: https://blog.linformatronics.nl/wp-uploads/2013/01/ccs5licence1.png

From the settings => media page in WordPress:

Uploading Files
Store uploads in this folder /srv/www/wp-uploads/blog.linformatronics.nl    
Full URL path to files       http://blog.linformatronics.nl/wp-uploads  

I’m fairly new to WordPress, so I still need to find my way around a bit.

Related posts

Leave a Reply

4 comments

  1. I think the problem is that you are storing your images in /srv/www/wp-uploads/blog.linformatronics.nl/2013/01 but your link to the image is https://blog.linformatronics.nl/wp-uploads/2013/01/ccs5licence1.png.

    What you need to do is tell wordpress to store the images in /srv/www/blog.linformatronics.nl/wp-uploads/2013/01.

    What your trying to do, it seems, is store images in wp-uploads/blog.linformatronics.nl but the folders should be swapped. It’s the website name and then the wp-uploads folder.

  2. Just ran into this problem and found that navigating to Settings > Media and then changing the Full URL path to files setting from

    http://<domain>/wp-uploads
    

    to

    http://<domain>/wp-uploads/<domain>
    

    eg http://blog.mysite.com/wp-uploads/blog.mysite.com

  3. You are telling WordPress to store the images outside the path of your WordPress install. It is doing that but is then not able to access them.

    If you specifiy a path within the WordPress install (the default is wordpress/wp-content/uploads/) WordPress will be able to find the stored images.

  4. A reason for this behavior also could be, that, after moving your DB improperly, the auto increment (A_I) property is missing on your tables.

    Thus, make sure you have the A_I set on the posts table (and all
    others) again.