FilesUploadFeature
Assembly: ServiceStack.dll
View Source
Declaration
public class FilesUploadFeature : IPlugin, IHasStringId, IHasId<string>, IPreInitPlugin
Properties
Id
View Source
Declaration
public string Id { get; }
Locations
View Source
Declaration
public UploadLocation[] Locations { get; set; }
BasePath
View Source
Declaration
public string BasePath { get; set; }
Errors
View Source
Declaration
public FilesUploadErrorMessages Errors { get; set; }
Methods
GetLocation(String)
View Source
Declaration
public UploadLocation GetLocation(string name)
Returns
Parameters
Type | Name |
---|---|
System.String | name |
GetLocationFromProperty(Type, String)
View Source
Declaration
public UploadLocation GetLocationFromProperty(Type requestType, string propName)
Returns
Parameters
Type | Name |
---|---|
System.Type | requestType |
System.String | propName |
BeforePluginsLoaded(IAppHost)
View Source
Declaration
public void BeforePluginsLoaded(IAppHost appHost)
Parameters
Type | Name |
---|---|
ServiceStack.IAppHost | appHost |
Register(IAppHost)
View Source
Declaration
public void Register(IAppHost appHost)
Parameters
Type | Name |
---|---|
ServiceStack.IAppHost | appHost |
AssertLocation(String, IRequest)
View Source
Declaration
public UploadLocation AssertLocation(string name, IRequest req = null)
Returns
Parameters
Type | Name |
---|---|
System.String | name |
ServiceStack.Web.IRequest | req |
UploadFileAsync(UploadLocation, IRequest, IAuthSession, IHttpFile, CancellationToken)
View Source
Declaration
public async Task<string> UploadFileAsync(UploadLocation location, IRequest req, IAuthSession session, IHttpFile file, CancellationToken token = default(CancellationToken))
Returns
System.Threading.Tasks.Task<System.String>
Parameters
Type | Name |
---|---|
ServiceStack.UploadLocation | location |
ServiceStack.Web.IRequest | req |
ServiceStack.Auth.IAuthSession | session |
ServiceStack.Web.IHttpFile | file |
System.Threading.CancellationToken | token |
ResolveUploadFilePath(FilesUploadContext)
View Source
Declaration
public ResolvedPath ResolveUploadFilePath(FilesUploadContext ctx)
Returns
Parameters
Type | Name |
---|---|
ServiceStack.FilesUploadContext | ctx |
ValidateFileUpload(UploadLocation, IRequest, IHttpFile, String)
View Source
Declaration
public void ValidateFileUpload(UploadLocation location, IRequest req, IHttpFile file, string vfsPath)
Parameters
Type | Name |
---|---|
ServiceStack.UploadLocation | location |
ServiceStack.Web.IRequest | req |
ServiceStack.Web.IHttpFile | file |
System.String | vfsPath |
GetFileAsync(UploadLocation, IRequest, IAuthSession, String)
View Source
Declaration
public async Task<IVirtualFile> GetFileAsync(UploadLocation location, IRequest req, IAuthSession session, string vfsPath)
Returns
System.Threading.Tasks.Task<ServiceStack.IO.IVirtualFile>
Parameters
Type | Name |
---|---|
ServiceStack.UploadLocation | location |
ServiceStack.Web.IRequest | req |
ServiceStack.Auth.IAuthSession | session |
System.String | vfsPath |
ReplaceFileAsync(UploadLocation, IRequest, IAuthSession, String, CancellationToken)
View Source
Declaration
public async Task ReplaceFileAsync(UploadLocation location, IRequest req, IAuthSession session, string vfsPath, CancellationToken token = default(CancellationToken))
Returns
System.Threading.Tasks.Task
Parameters
Type | Name |
---|---|
ServiceStack.UploadLocation | location |
ServiceStack.Web.IRequest | req |
ServiceStack.Auth.IAuthSession | session |
System.String | vfsPath |
System.Threading.CancellationToken | token |
DeleteFileAsync(UploadLocation, IRequest, IAuthSession, String)
View Source
Declaration
public async Task<bool> DeleteFileAsync(UploadLocation location, IRequest req, IAuthSession session, string vfsPath)
Returns
System.Threading.Tasks.Task<System.Boolean>
Parameters
Type | Name |
---|---|
ServiceStack.UploadLocation | location |
ServiceStack.Web.IRequest | req |
ServiceStack.Auth.IAuthSession | session |
System.String | vfsPath |