开发者

wordpress image uploads

I have created my own upload function for forms on my sites frontend. the images upload correctly, but in some cases a blan开发者_如何转开发k 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.


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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜