Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

Swaz's avatar
Level 20

Envoyer, maintain user uploads between releases

I got my project setup with Envoyer / Forge. I have an uploads directory in public/uploads. This is where all the users uploads go, but every time I deploy, the uploads folder gets removed. How can I persist the user uploads between releases?

0 likes
8 replies
mstnorris's avatar

Isn't it the storage folder? I can't remember exactly from Jeffrey's series. Have you watched it?

Swaz's avatar
Level 20

@mstnorris Yea I think I need to move the uploads folder to the storage directory. Not sure how to display an image that is not stored in the public folder though. Do you know how? I don't recall this being covered in the videos.

Swaz's avatar
Level 20

@mstnorris storage_path() seems to returns the path from the root of the server. So when I add it to the html, the link it generates is my-site.com/[path to storage directory]

foxted's avatar

I had the same problem on a project of mine.

I solved it by moving the uploads directory one level up (where the current, releases and storage directories are) and used a deployment hook to create a symbolic link in the public directory.

You can also move it in the storage directory if you prefer, should work the same.

1 like
opheliadesign's avatar

@foxted could you share the deployment hook?

I'm trying to use OpenVBX (a Twilio powered phone system) that needs to be accessible from the public directory. I added it to my project under public/vbx but every time I deploy it's starting from scratch, so it wipes out whatever files it generates after installing (so basically an installation loop, having to re-install after every deployment).

This is a hugely annoying issue at the moment. I thought that the public directory wasn't messed with by Envoyer, must have misunderstood that.

foxted's avatar

@opheliadesign

  1. Create your VBX folder in /home/forge/{domain_name} or /home/forge/{domain_name}/storage
  2. Create the deployment hook:
cd {{release}}/public
ln -s /home/forge/{domain_name}/vbx vbx

Done ;)

1 like

Please or to participate in this conversation.