Skip to main content
Add some options one could take for a live site that already has files.
Source Link
rovr138
  • 1k
  • 5
  • 8

the file is stored on public file system

The problem with using the public file system is that the file is actually served by your web server, not Drupal.

So if you want to manipulate it in any way, you'll have to switch to private. This does add more overhead. Test your configuration with big file sizes to see if they're handled okay.

Your other option is changing the path where the files are stored. You can use a token that includes the date (maybe time? depends how frequently they might be updated) of when the file was uploaded. Most files will end up in different folders and that will solve your issue since files are only renamed if there's a collision in the folder it's writing to.

 

For a live site with files, there are 3 options I can think of.

Option 1: if there’s a pattern to the files, you could modify the .htaccess so those are rewritten to the index.php.

Option 2: You can change the public file path to something else. You can then change the private file path to the previous public one. This would mean all current files would now be served as private. You would need to adjust the fields you want so they now write to private.

Option 3: Modify the path of the files you want on the database so they are served from the private path. Then move those files from the public file path to the private file path.

the file is stored on public file system

The problem with using the public file system is that the file is actually served by your web server, not Drupal.

So if you want to manipulate it in any way, you'll have to switch to private. This does add more overhead. Test your configuration with big file sizes to see if they're handled okay.

Your other option is changing the path where the files are stored. You can use a token that includes the date (maybe time? depends how frequently they might be updated) of when the file was uploaded. Most files will end up in different folders and that will solve your issue since files are only renamed if there's a collision in the folder it's writing to.

the file is stored on public file system

The problem with using the public file system is that the file is actually served by your web server, not Drupal.

So if you want to manipulate it in any way, you'll have to switch to private. This does add more overhead. Test your configuration with big file sizes to see if they're handled okay.

Your other option is changing the path where the files are stored. You can use a token that includes the date (maybe time? depends how frequently they might be updated) of when the file was uploaded. Most files will end up in different folders and that will solve your issue since files are only renamed if there's a collision in the folder it's writing to.

 

For a live site with files, there are 3 options I can think of.

Option 1: if there’s a pattern to the files, you could modify the .htaccess so those are rewritten to the index.php.

Option 2: You can change the public file path to something else. You can then change the private file path to the previous public one. This would mean all current files would now be served as private. You would need to adjust the fields you want so they now write to private.

Option 3: Modify the path of the files you want on the database so they are served from the private path. Then move those files from the public file path to the private file path.

Source Link
rovr138
  • 1k
  • 5
  • 8

the file is stored on public file system

The problem with using the public file system is that the file is actually served by your web server, not Drupal.

So if you want to manipulate it in any way, you'll have to switch to private. This does add more overhead. Test your configuration with big file sizes to see if they're handled okay.

Your other option is changing the path where the files are stored. You can use a token that includes the date (maybe time? depends how frequently they might be updated) of when the file was uploaded. Most files will end up in different folders and that will solve your issue since files are only renamed if there's a collision in the folder it's writing to.