File tree 1 file changed +7
-2
lines changed
packages/modules/providers/file-local/src/services
1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -12,8 +12,13 @@ export class LocalFileService extends AbstractFileProviderService {
12
12
constructor ( _ , options : LocalFileServiceOptions ) {
13
13
super ( )
14
14
this . uploadDir_ = options ?. upload_dir || path . join ( process . cwd ( ) , "static" )
15
+
16
+ // Since there is no way to serve private files through a static server, we simply place them in `static`.
17
+ // This means that the files will be available publicly if the filename is known. Since the local file provider
18
+ // is for development only, this shouldn't be an issue. If you really want to use it in production (and you shouldn't)
19
+ // You can change the private upload dir to `/private` but none of the functionalities where you use a presigned URL will work.
15
20
this . privateUploadDir_ =
16
- options ?. private_upload_dir || path . join ( process . cwd ( ) , "private " )
21
+ options ?. private_upload_dir || path . join ( process . cwd ( ) , "static " )
17
22
this . backendUrl_ = options ?. backend_url || "http://localhost:9000/static"
18
23
}
19
24
@@ -73,7 +78,7 @@ export class LocalFileService extends AbstractFileProviderService {
73
78
}
74
79
75
80
// For private files, we simply return the file path, which can then be loaded manually by the backend.
76
- // The local file provider doesn't support presigned URLs for private files.
81
+ // The local file provider doesn't support presigned URLs for private files (i.e files not placed in /static) .
77
82
async getPresignedDownloadUrl (
78
83
file : FileTypes . ProviderGetFileDTO
79
84
) : Promise < string > {
You can’t perform that action at this time.
0 commit comments