How to handle uploads files ?
Hello, I am using easy-deploy-bundle in my project, and recently I added file upload to my website. So I store files under current/public/uploads directory. But when I deploy a new release of my projects, I loose all of the files under the current/public/uploads directory (since easydeploy creates a new one). Is there an option which handles this case ?
Thanks in advance
Hello, I am using easy-deploy-bundle in my project, and recently I added file upload to my website. So I store files under current/public/uploads directory. But when I deploy a new release of my projects, I loose all of the files under the current/public/uploads directory (since easydeploy creates a new one). Is there an option which handles this case ?
Thanks in advance
You can set it as share folder in deploy.php:
public function configure()
{
return $this->getConfigBuilder()
// ....
->sharedFilesAndDirs(['public/uploads'])
;
}
After deploy to server, you have two choice:
- If your uploads folder contains lots of files, just copy your
uploadsfolder to theshareddirectory created by deployer. - Or create a new
uploadsfolder in theshareddirectory created by deployer.
so next time you can just deploy a new release without worrying the uploads folder.