PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Thursday, June 30, 2022

[FIXED] What is the best place to store module uploaded images

 June 30, 2022     prestashop, prestashop-1.6, prestashop-1.7     No comments   

Issue

I am creating a module that allows to create some objects and upload images for them.

For the moment, I am uploading images in the module folder itself. But I think it is better to store them in PS img folder like for product and category images. One of the reasons is to avoid their deletion when module is deleted mistakenly from backoffice.

Is there any other reason to store/ not store images in img folder? What is the best place to store a huge number of uploaded images?

Your ideas are much appreciated. Thanks in advance.


Solution

Yes, it's better to save your images in the img folder. The most important reason for doing this: this route will never be blocked by robots.txt.

In my modules, (in order to be more orderly,) I create a folder called "module" and then inside this folder, I create another folder called the my-module-name.

img/modules/my-custom-module/test.jpg



Answered By - Mahdi Shad
Answer Checked By - David Marino (PHPFixing Volunteer)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing