How to convert File to FileParameter in Typescript?
See original GitHub issueHi,
I tried to find the information in the issues, wiki and stackoverflow but I didn’t find it.
In my Api, there is a DTO with a IFormFile, which generate using nswastudio a function asking for a FileParameter.
export interface FileParameter {
data: any;
fileName: string;
}
When a file is selected with input type=file, I don’t know how to convert the File to a FileParameter.
How could I do that?
Thanks
Issue Analytics
- State:
- Created 4 years ago
- Comments:7 (1 by maintainers)
Top Results From Across the Web
How to extract data and file name from args for upload files?
2: Change public files: Array<FileParameter> = new Array<FileParam>(); to public files: Array<any> = new Array<any>();.
Read more >File: File() constructor - Web APIs - MDN Web Docs
The File() constructor creates a new File object instance.
Read more >script - Makes a typescript of a terminal session
Begin recording the shell session activity by issuing the script command: script · Start removing the files and then end the recording of...
Read more >Upload Small Files to a Web API Using Angular
Convert the file data into a byte array using the FromBase64String() method on the .NET Convert class. Store the results of calling this...
Read more >File upload | NestJS - A progressive Node.js framework
To upload a single file, simply tie the FileInterceptor() interceptor to the route handler and extract file from the request using the @UploadedFile()...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
This worked for me
Thanks for your help:)