This is not a answer, is an extended comment with the link to the solution.
First, while testing, one of my test sites wasn’t showing the Featured Image uploaded to the folder /wp-content/uploads/POST_ID/image_name.jpg
. Same problem as the OP.
But, it was not displaying any path to the image. And the bug was that the installation where I was testing is full of hacks (my main WPSE testing base). As soon as I went to a stable installation everything worked.
So, if your problem persist, do a full troubleshooting:
http://wordpress.org/support/topic/troubleshooting-wordpress-33-master-list
Also, Robert, when asking a question please provide all the elements that a person who is willing to help will need to understand and effectively answer it.
Side notes to your code:
mkdir
is not necessary, WordPress handles this- don’t hardcode the path or URL of
wp-content
, you can use the constants WP_CONTENT_DIR and WP_CONTENT_URL
Best regards and good luck!