views:

63

answers:

1

I have created my own upload function for forms on my sites frontend. the images upload correctly, but in some cases a blank reference to the image with this as its path: /USR/WWW/USERS//WP-CONTENT/BLOGS.DIR/2/FILES/ occurs in the media library. its seems as though the form uploads images but where there is no image to upload a blank reference is 'uploaded' instead. any ideas of what may be causing this? deleting these empty rows in the db does not affect the site, but seems like bad practice.

A: 

Hi. I agree with Andrew Bolster, we need a bit more information to help you.

However, based on my own experience, it might be a problem with the filenames themselves. I found WordPress's own function for creating filenames, santize_file_name(), and that saved me a lot of trouble personally.

Check out the details here: http://codex.wordpress.org/Function_Reference/sanitize_file_name

Lars Koudal