diff --git a/src/Blazor.FileReader/FileReaderJsInterop.Base64Stream.cs b/src/Blazor.FileReader/FileReaderJsInterop.Base64Stream.cs index 1fb5bec..6d9da7b 100644 --- a/src/Blazor.FileReader/FileReaderJsInterop.Base64Stream.cs +++ b/src/Blazor.FileReader/FileReaderJsInterop.Base64Stream.cs @@ -4,7 +4,7 @@ namespace Blazor.FileReader { - internal partial class FileReaderJsInterop + public partial class FileReaderJsInterop { private class Base64Stream : IBase64Stream { diff --git a/src/Blazor.FileReader/FileReaderJsInterop.InteropFileStream.cs b/src/Blazor.FileReader/FileReaderJsInterop.InteropFileStream.cs index 94bf481..7a07ad1 100644 --- a/src/Blazor.FileReader/FileReaderJsInterop.InteropFileStream.cs +++ b/src/Blazor.FileReader/FileReaderJsInterop.InteropFileStream.cs @@ -5,7 +5,7 @@ namespace Blazor.FileReader { - internal partial class FileReaderJsInterop + public partial class FileReaderJsInterop { private class InteropFileStream : AsyncDisposableStream { diff --git a/src/Blazor.FileReader/FileReaderJsInterop.cs b/src/Blazor.FileReader/FileReaderJsInterop.cs index 8d6bbd4..de2aa4e 100644 --- a/src/Blazor.FileReader/FileReaderJsInterop.cs +++ b/src/Blazor.FileReader/FileReaderJsInterop.cs @@ -10,12 +10,15 @@ namespace Blazor.FileReader { - internal partial class FileReaderJsInterop + public partial class FileReaderJsInterop { private static readonly IReadOnlyDictionary escapeScriptTextReplacements = new Dictionary { { @"\", @"\\" }, { "\r", @"\r" }, { "\n", @"\n" }, { "'", @"\'" }, { "\"", @"\""" } }; private readonly bool _needsInitialization = false; private readonly IFileReaderServiceOptions _options; + private static long _readFileUnmarshalledCallIdSource; + private static readonly Dictionary> _readFileUnmarshalledCalls + = new Dictionary>(); internal IJSRuntime CurrentJSRuntime { get; } @@ -130,19 +133,51 @@ private async Task ReadFileUnmarshalledAsync( int fileRef, byte[] buffer, long position, long bufferOffset, int count, CancellationToken cancellationToken) { - - var bytesRead = await Task.Run(() => CurrentJSRuntime.InvokeUnmarshalled( + var taskCompletionSource = new TaskCompletionSource(); + var id = ++_readFileUnmarshalledCallIdSource; + _readFileUnmarshalledCalls[id] = taskCompletionSource; + + await Task.Run(() => CurrentJSRuntime.InvokeUnmarshalled( $"FileReaderComponent.ReadFileUnmarshalledAsync", new ReadFileParams { Buffer = buffer, BufferOffset = bufferOffset, Count = count, FileRef = fileRef, - Position = position + Position = position, + TaskId = id })); + + var bytesRead = await taskCompletionSource.Task; return bytesRead; } + [JSInvokable(nameof(EndReadFileUnmarshalledAsyncResult))] + public static void EndReadFileUnmarshalledAsyncResult(long taskId, int bytesRead) + { + if (!_readFileUnmarshalledCalls.TryGetValue(taskId, out var taskCompletionSource)) { + Console.Error.WriteLine($"{nameof(EndReadFileUnmarshalledAsyncResult)}: Unknown {nameof(taskId)} '{taskId}'"); + return; + } + + _readFileUnmarshalledCalls.Remove(taskId); + taskCompletionSource.SetResult(bytesRead); + } + + + [JSInvokable(nameof(EndReadFileUnmarshalledAsyncError))] + public static void EndReadFileUnmarshalledAsyncError(long taskId, string error) + { + if (!_readFileUnmarshalledCalls.TryGetValue(taskId, out var taskCompletionSource)) + { + Console.Error.WriteLine($"{nameof(EndReadFileUnmarshalledAsyncError)}: Unknown {nameof(taskId)} '{taskId}'"); + return; + } + + _readFileUnmarshalledCalls.Remove(taskId); + taskCompletionSource.SetException(new BrowserFileReaderException(error)); + } + private async Task Initialize() { var isLoaded = await IsLoaded(); diff --git a/src/Blazor.FileReader/ReadFileParams.cs b/src/Blazor.FileReader/ReadFileParams.cs index d2166ee..19a4183 100644 --- a/src/Blazor.FileReader/ReadFileParams.cs +++ b/src/Blazor.FileReader/ReadFileParams.cs @@ -5,17 +5,30 @@ namespace Blazor.FileReader [StructLayout(LayoutKind.Explicit)] struct ReadFileParams - { + { [FieldOffset(0)] - internal long BufferOffset; + public long TaskId; + [FieldOffset(8)] - internal int Count; - [FieldOffset(12)] - internal int FileRef; + public long BufferOffset; + [FieldOffset(16)] - public long Position; + public int Count; + + [FieldOffset(20)] + public int FileRef; + [FieldOffset(24)] + public long Position; + + [FieldOffset(32)] public byte[] Buffer; } + public struct ReadFileResult + { + public long TaskId; + public int BytesRead; + public string Error; + } } diff --git a/src/Blazor.FileReader/script/FileReaderComponent.ts b/src/Blazor.FileReader/script/FileReaderComponent.ts index c65a29e..1159ac1 100644 --- a/src/Blazor.FileReader/script/FileReaderComponent.ts +++ b/src/Blazor.FileReader/script/FileReaderComponent.ts @@ -1,5 +1,9 @@ declare const Blazor: IBlazor; +declare const DotNet: IDotNet; +interface IDotNet { + invokeMethodAsync(assemblyName: string, methodIdentifier: string, ...args: any[]): Promise; +} interface IBlazor { platform: IBlazorPlatform; } @@ -21,6 +25,7 @@ interface IBlazorPlatform { } interface IReadFileParams { + taskId: number; buffer: System_Array; bufferOffset: number; count: number; @@ -28,6 +33,11 @@ interface IReadFileParams { position: number; }; +interface ReadFileSliceResult { + file: File; + result: string | ArrayBuffer; +} + interface IFileInfo { name: string; nonStandardProperties: any; @@ -43,7 +53,7 @@ interface IDotNetBuffer { class FileReaderComponent { private newFileStreamReference = 0; - private readonly fileStreams: { [reference: number]: { file: File, arrayBuffer: ArrayBuffer } } = {}; + private readonly fileStreams: { [reference: number]: File } = {}; private readonly dragElements: Map = new Map(); private readonly elementDataTransfers: Map = new Map(); @@ -124,7 +134,7 @@ class FileReaderComponent { return 0; }; - public GetFileInfoFromElement = (element: HTMLElement, index: number, property: string): IFileInfo => { + public GetFileInfoFromElement = (element: HTMLElement, index: number): IFileInfo => { this.LogIfNull(element); const files = this.GetFiles(element); if (!files) { @@ -144,15 +154,15 @@ class FileReaderComponent { } public GetFileInfoFromFile(file: File): IFileInfo { - var result = { + const result = { lastModified: file.lastModified, name: file.name, nonStandardProperties: null, size: file.size, type: file.type }; - var properties: any = new Object(); - for (let property in file) { + const properties: { [propertyName: string]: object } = {}; + for (const property in file) { if (Object.getPrototypeOf(file).hasOwnProperty(property) && !(property in result)) { properties[property] = file[property]; } @@ -161,74 +171,88 @@ class FileReaderComponent { return result; } - public OpenRead = (element: HTMLElement, fileIndex: number): Promise => { + public OpenRead = (element: HTMLElement, fileIndex: number): number => { this.LogIfNull(element); - return new Promise((resolve, reject) => { - const files = this.GetFiles(element); - if (!files) { - throw 'No FileList available.'; - } - const file = files.item(fileIndex); - if (!file) { - throw `No file with index ${fileIndex} available.`; - } - - const fileRef: number = this.newFileStreamReference++; - const reader = new FileReader(); - reader.onload = ((r) => { - return () => { - try { - const arrayBuffer: ArrayBuffer = r.result as ArrayBuffer; - this.fileStreams[fileRef] = { file, arrayBuffer }; - - resolve(fileRef); - } catch (e) { - reject(e); - } - } - })(reader); - reader.readAsArrayBuffer(file); + + const files = this.GetFiles(element); + if (!files) { + throw 'No FileList available.'; + } + const file = files.item(fileIndex); + if (!file) { + throw `No file with index ${fileIndex} available.`; + } - return fileRef; - }); + const fileRef: number = this.newFileStreamReference++; + this.fileStreams[fileRef] = file; + return fileRef; + } public ReadFileParamsPointer = (readFileParamsPointer: Pointer): IReadFileParams => { return { - bufferOffset: Blazor.platform.readUint64Field(readFileParamsPointer, 0), - count: Blazor.platform.readInt32Field(readFileParamsPointer, 8), - fileRef: Blazor.platform.readInt32Field(readFileParamsPointer, 12), - position: Blazor.platform.readUint64Field(readFileParamsPointer, 16), - buffer: Blazor.platform.readInt32Field(readFileParamsPointer, 24) as unknown as System_Array + taskId: Blazor.platform.readUint64Field(readFileParamsPointer, 0), + bufferOffset: Blazor.platform.readUint64Field(readFileParamsPointer, 8), + count: Blazor.platform.readInt32Field(readFileParamsPointer, 16), + fileRef: Blazor.platform.readInt32Field(readFileParamsPointer, 20), + position: Blazor.platform.readUint64Field(readFileParamsPointer, 24), + buffer: Blazor.platform.readInt32Field(readFileParamsPointer, 32) as unknown as System_Array }; } + public ReadFileUnmarshalledAsync = (readFileParamsPointer: Pointer) => { const readFileParams = this.ReadFileParamsPointer(readFileParamsPointer); - const fileStream = this.fileStreams[readFileParams.fileRef]; - const dotNetBuffer = readFileParams.buffer; - const dotNetBufferView: Uint8Array = Blazor.platform.toUint8Array(dotNetBuffer); - const byteCount = Math.min(fileStream.arrayBuffer.byteLength - readFileParams.position, readFileParams.count); - dotNetBufferView.set(new Uint8Array(fileStream.arrayBuffer, readFileParams.position, byteCount), readFileParams.bufferOffset); - return byteCount; + + const asyncCall = new Promise((resolve, reject) => { + return this.ReadFileSlice(readFileParams, (r,b) => r.readAsArrayBuffer(b)) + .then(r => { + try { + const dotNetBufferView = Blazor.platform.toUint8Array(readFileParams.buffer); + const arrayBuffer = r.result as ArrayBuffer; + dotNetBufferView.set(new Uint8Array(arrayBuffer), readFileParams.bufferOffset); + + const byteCount = Math.min(arrayBuffer.byteLength, readFileParams.count); + resolve(byteCount); + } catch (e) { + reject(e); + } + }, e => reject(e)); + }); + + asyncCall.then( + byteCount => DotNet.invokeMethodAsync("Blazor.FileReader", "EndReadFileUnmarshalledAsyncResult", readFileParams.taskId, byteCount), + error => { + console.error("ReadFileUnmarshalledAsync error", error); + DotNet.invokeMethodAsync("Blazor.FileReader", "EndReadFileUnmarshalledAsyncError", readFileParams.taskId, error.toString()); + }); } public ReadFileMarshalledAsync = (readFileParams: IReadFileParams): Promise => { - return new Promise((resolve, reject) => { - const file: File = this.fileStreams[readFileParams.fileRef].file; + return this.ReadFileSlice(readFileParams, (r,b) => r.readAsDataURL(b)) + .then(r => { + const contents = r.result as string; + const data = contents ? contents.split(";base64,")[1] : null; + resolve(data); + }, e => reject(e)); + }); + } + + + private ReadFileSlice = (readFileParams: IReadFileParams, method: (reader: FileReader, blob: Blob) => void): Promise => { + return new Promise((resolve, reject) => { + const file: File = this.fileStreams[readFileParams.fileRef]; try { const reader = new FileReader(); reader.onload = ((r) => { return () => { try { - const contents = r.result as string; - const data = contents ? contents.split(";base64,")[1] : null; - resolve(data); + resolve({result: r.result, file: file }); } catch (e) { reject(e); } } })(reader); - reader.readAsDataURL(file.slice(readFileParams.position, readFileParams.position + readFileParams.count)); + method(reader, file.slice(readFileParams.position, readFileParams.position + readFileParams.count)); } catch (e) { reject(e); } diff --git a/src/Blazor.FileReader/wwwroot/FileReaderComponent.js b/src/Blazor.FileReader/wwwroot/FileReaderComponent.js index 41f24c7..61e99b7 100755 --- a/src/Blazor.FileReader/wwwroot/FileReaderComponent.js +++ b/src/Blazor.FileReader/wwwroot/FileReaderComponent.js @@ -57,7 +57,7 @@ var FileReaderComponent = (function () { } return 0; }; - this.GetFileInfoFromElement = function (element, index, property) { + this.GetFileInfoFromElement = function (element, index) { _this.LogIfNull(element); var files = _this.GetFiles(element); if (!files) { @@ -74,69 +74,76 @@ var FileReaderComponent = (function () { }; this.OpenRead = function (element, fileIndex) { _this.LogIfNull(element); - return new Promise(function (resolve, reject) { - var files = _this.GetFiles(element); - if (!files) { - throw 'No FileList available.'; - } - var file = files.item(fileIndex); - if (!file) { - throw "No file with index " + fileIndex + " available."; - } - var fileRef = _this.newFileStreamReference++; - var reader = new FileReader(); - reader.onload = (function (r) { - return function () { - try { - var arrayBuffer = r.result; - _this.fileStreams[fileRef] = { file: file, arrayBuffer: arrayBuffer }; - resolve(fileRef); - } - catch (e) { - reject(e); - } - }; - })(reader); - reader.readAsArrayBuffer(file); - return fileRef; - }); + var files = _this.GetFiles(element); + if (!files) { + throw 'No FileList available.'; + } + var file = files.item(fileIndex); + if (!file) { + throw "No file with index " + fileIndex + " available."; + } + var fileRef = _this.newFileStreamReference++; + _this.fileStreams[fileRef] = file; + return fileRef; }; this.ReadFileParamsPointer = function (readFileParamsPointer) { return { - bufferOffset: Blazor.platform.readUint64Field(readFileParamsPointer, 0), - count: Blazor.platform.readInt32Field(readFileParamsPointer, 8), - fileRef: Blazor.platform.readInt32Field(readFileParamsPointer, 12), - position: Blazor.platform.readUint64Field(readFileParamsPointer, 16), - buffer: Blazor.platform.readInt32Field(readFileParamsPointer, 24) + taskId: Blazor.platform.readUint64Field(readFileParamsPointer, 0), + bufferOffset: Blazor.platform.readUint64Field(readFileParamsPointer, 8), + count: Blazor.platform.readInt32Field(readFileParamsPointer, 16), + fileRef: Blazor.platform.readInt32Field(readFileParamsPointer, 20), + position: Blazor.platform.readUint64Field(readFileParamsPointer, 24), + buffer: Blazor.platform.readInt32Field(readFileParamsPointer, 32) }; }; this.ReadFileUnmarshalledAsync = function (readFileParamsPointer) { var readFileParams = _this.ReadFileParamsPointer(readFileParamsPointer); - var fileStream = _this.fileStreams[readFileParams.fileRef]; - var dotNetBuffer = readFileParams.buffer; - var dotNetBufferView = Blazor.platform.toUint8Array(dotNetBuffer); - var byteCount = Math.min(fileStream.arrayBuffer.byteLength - readFileParams.position, readFileParams.count); - dotNetBufferView.set(new Uint8Array(fileStream.arrayBuffer, readFileParams.position, byteCount), readFileParams.bufferOffset); - return byteCount; + var asyncCall = new Promise(function (resolve, reject) { + return _this.ReadFileSlice(readFileParams, function (r, b) { return r.readAsArrayBuffer(b); }) + .then(function (r) { + try { + var dotNetBufferView = Blazor.platform.toUint8Array(readFileParams.buffer); + var arrayBuffer = r.result; + dotNetBufferView.set(new Uint8Array(arrayBuffer), readFileParams.bufferOffset); + var byteCount = Math.min(arrayBuffer.byteLength, readFileParams.count); + resolve(byteCount); + } + catch (e) { + reject(e); + } + }, function (e) { return reject(e); }); + }); + asyncCall.then(function (byteCount) { return DotNet.invokeMethodAsync("Blazor.FileReader", "EndReadFileUnmarshalledAsyncResult", readFileParams.taskId, byteCount); }, function (error) { + console.error("ReadFileUnmarshalledAsync error", error); + DotNet.invokeMethodAsync("Blazor.FileReader", "EndReadFileUnmarshalledAsyncError", readFileParams.taskId, error.toString()); + }); }; this.ReadFileMarshalledAsync = function (readFileParams) { return new Promise(function (resolve, reject) { - var file = _this.fileStreams[readFileParams.fileRef].file; + return _this.ReadFileSlice(readFileParams, function (r, b) { return r.readAsDataURL(b); }) + .then(function (r) { + var contents = r.result; + var data = contents ? contents.split(";base64,")[1] : null; + resolve(data); + }, function (e) { return reject(e); }); + }); + }; + this.ReadFileSlice = function (readFileParams, method) { + return new Promise(function (resolve, reject) { + var file = _this.fileStreams[readFileParams.fileRef]; try { var reader = new FileReader(); reader.onload = (function (r) { return function () { try { - var contents = r.result; - var data = contents ? contents.split(";base64,")[1] : null; - resolve(data); + resolve({ result: r.result, file: file }); } catch (e) { reject(e); } }; })(reader); - reader.readAsDataURL(file.slice(readFileParams.position, readFileParams.position + readFileParams.count)); + method(reader, file.slice(readFileParams.position, readFileParams.position + readFileParams.count)); } catch (e) { reject(e); @@ -173,7 +180,7 @@ var FileReaderComponent = (function () { size: file.size, type: file.type }; - var properties = new Object(); + var properties = {}; for (var property in file) { if (Object.getPrototypeOf(file).hasOwnProperty(property) && !(property in result)) { properties[property] = file[property]; diff --git a/src/Blazor.FileReader/wwwroot/FileReaderComponent.js.map b/src/Blazor.FileReader/wwwroot/FileReaderComponent.js.map index 24f90db..e0100f5 100755 --- a/src/Blazor.FileReader/wwwroot/FileReaderComponent.js.map +++ b/src/Blazor.FileReader/wwwroot/FileReaderComponent.js.map @@ -1 +1 @@ -{"version":3,"file":"FileReaderComponent.js","sourceRoot":"","sources":["../script/FileReaderComponent.ts"],"names":[],"mappings":"AA4BC,CAAC;AAQD,CAAC;AAMF;IAAA;QAAA,iBA8OC;QA5OW,2BAAsB,GAAG,CAAC,CAAC;QAClB,gBAAW,GAAsE,EAAE,CAAC;QACpF,iBAAY,GAAyD,IAAI,GAAG,EAAE,CAAC;QAC/E,yBAAoB,GAA+B,IAAI,GAAG,EAAE,CAAC;QAQvE,uBAAkB,GAAG,UAAC,OAAoB,EAAE,QAAiB;YAChE,KAAI,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC;YAExB,IAAM,OAAO,GAAG,UAAC,EAAa;gBAC1B,KAAI,CAAC,qBAAqB,CAAC,EAAE,CAAC,CAAC;gBAC/B,IAAI,EAAE,CAAC,MAAM,YAAY,WAAW,EAAE;oBAClC,IAAI,IAAI,GAAG,EAAE,CAAC,YAAY,CAAC,KAAK,CAAC;oBAEjC,IAAI,QAAQ,EAAE;wBACV,IAAM,QAAQ,GAAG,KAAI,CAAC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