File tree Expand file tree Collapse file tree 1 file changed +17
-0
lines changed
Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change 44using ServiceStack . Configuration ;
55using ServiceStack . Data ;
66using ServiceStack . Host . Handlers ;
7+ using ServiceStack . IO ;
78using ServiceStack . Logging ;
89using ServiceStack . NativeTypes . Java ;
910using ServiceStack . NativeTypes . TypeScript ;
@@ -141,6 +142,22 @@ public override void Configure(Container container)
141142 } ) ;
142143
143144 TypeScriptGenerator . ReturnTypeAliases [ typeof ( byte [ ] ) . Name ] = "Uint8Array" ;
145+
146+ var fileFs = new FileSystemVirtualFiles ( HostingEnvironment . ContentRootPath . CombineWith ( "App_Data/files" ) . AssertDir ( ) ) ;
147+ Plugins . Add ( new FilesUploadFeature (
148+ new UploadLocation ( "pub" ,
149+ fileFs ,
150+ readAccessRole : RoleNames . AllowAnon ,
151+ // requireApiKey: new(),
152+ maxFileBytes : 10 * 1024 * 1024 ,
153+ resolvePath : ctx => "pub" . CombineWith ( ctx . FileName ) ) ,
154+ new UploadLocation ( "secure" ,
155+ fileFs ,
156+ // requireApiKey: new(),
157+ maxFileBytes : 10 * 1024 * 1024 ,
158+ resolvePath : ctx => "secure" . CombineWith ( ctx . FileName ) )
159+ ) ) ;
160+
144161 }
145162
146163 private void CreateUser ( OrmLiteAuthRepository authRepo ,
You can’t perform that action at this time.
0 commit comments