0

I have been developing a plugin and I am confused at the moment whether to store in wordpress upload folder or my plugin folder. I will be storing image in custom table.I also got another technique to store image in blob format. Will I be able to store directly into database without uploading?

5
  • not sure what is the question here... the gut feeling is that it is wrong, but that fully depends on what is it that your plugin does and how it does it. Aug 25 '17 at 6:38
  • I need to store logos of the companies. Aug 25 '17 at 8:03
  • and why using the wordpress media API not good enough? Aug 25 '17 at 8:14
  • No. The logo will be related to company custom table. Aug 25 '17 at 8:19
  • I dont want the images to stay if the plugin is uninstalled. So better would be store in custom table. Aug 25 '17 at 8:21
3

The only directory in which you have guaranteed write access is the uploads directory. Even your plugin's directory might be write protected, the same for wp-content (which doesn't even have to exist).

2
-1

If there are only few images which are required for the plugin itself then store it under plugins own image folder. If you are making something else; where user will upload its own data then safely use uploads folder.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.