• /wp-content/plugins/plugin-name/pdfs/doc1690392639.pdf

    I could use some help, I developed a plug-in for a company to use that creates a pdf based on the customer’s request. The last time I checked everything was working fine, the code creates the file and puts in the right folder and takes the customer to the link above. Sometime in the last week or so it has stopped working.

    Everything with code still works, the file is created and put in the right folder, but the customer get a page not found link now. I know the client has update the php version ( I don’t believe that is it as my local version runs a newer version of php) and I think they might have upgraded the servers. The issue is on the live site and the staging site of which they don’t change the WordPress settings on. My only guess is it’s something to do with the server and/or folder permissions but I don’t know where to go to fix that.

    I’m new to WordPress plug-in development so any advice in any way is appreciated. Thanks.

Viewing 1 replies (of 1 total)
  • Moderator threadi

    (@threadi)

    You should never put user-created files in your own plugin directory. Once he reinstalls OR updates your plugin, the files will be removed.

    If you want to create files with your plugin, put them in the wp-content/uploads/ directory. There you can also create a subdirectory with the name of your plugin so that it can be distinguished from other files there. In this way, the files are retained even when you update or reinstall your plugin and are also included in data backups that the user creates from the uploads directory.

    Have a look at the function here for development: https://developer.ww.wp.xz.cn/reference/functions/wp_upload_dir/ – this will take you to the uploads directory. The rest should be the way you currently create and save the files, just with a different directory as the target.

Viewing 1 replies (of 1 total)

The topic ‘plugins file folder not accessible’ is closed to new replies.