Update libraries
This commit is contained in:
@@ -23,7 +23,7 @@ namespace Backload.Helper
|
||||
// RequestType.Default: Json output has been requested (default).
|
||||
// Otherwise a file or a thumbnail (bytes) will be returned.
|
||||
if (result.RequestType == RequestType.Default)
|
||||
return Create((IFileStatusResult)result);
|
||||
return Create((IJsonResult)result);
|
||||
else if ((result.RequestType == RequestType.File) || (result.RequestType == RequestType.Thumbnail))
|
||||
return Create((IFileDataResult)result);
|
||||
}
|
||||
@@ -39,13 +39,21 @@ namespace Backload.Helper
|
||||
/// </summary>
|
||||
/// <param name="result">A IFileStatusResult object with client plugin specfic data.</param>
|
||||
/// <returns>JsonResult instance or a http HttpStatusCodeResult to send an http status</returns>
|
||||
public static ActionResult Create(IFileStatusResult result)
|
||||
public static ActionResult Create(IJsonResult result)
|
||||
{
|
||||
object resultObject = null;
|
||||
|
||||
// Converts to the correct type and gets the result object. Result is usually in ClientStatus
|
||||
if (result.ResultType == ResultType.Status)
|
||||
resultObject = ((IFileStatusResult)result).ClientStatus;
|
||||
else if (result.ResultType == ResultType.Json)
|
||||
resultObject = ((ICoreResult)result).ResultObject;
|
||||
|
||||
// Create Json result from the returned client plugin specific file metadata.
|
||||
if ((result.ClientStatus != null) && (result.Exception == null))
|
||||
if ((resultObject != null) && (result.Exception == null))
|
||||
return new JsonResult()
|
||||
{
|
||||
Data = result.ClientStatus,
|
||||
Data = resultObject,
|
||||
ContentType = result.ContentType,
|
||||
ContentEncoding = System.Text.Encoding.UTF8,
|
||||
MaxJsonLength = Int32.MaxValue,
|
||||
|
||||
Reference in New Issue
Block a user