Thank you all for watching and for your support. ►► If you want to master Web API development using best practices, check out our Web API book: bit.ly/3x75ZMM ►► Also, to build great full-stack apps with Blazor, check out our course: bit.ly/3Pw3Y33
@lachlanwilson63892 ай бұрын
Works beautifully, thanks Marinko!
@CodeMaze2 ай бұрын
You are very welcome. Thank you too for watchng the video and sharing your comment.
@jacksonmwangi16684 ай бұрын
@CodeMaze, thank you very much for this video, it couldn't have come at a better time
@CodeMaze4 ай бұрын
You are most welcome. Thank you for watching it. I'm glad it helps.
@Mr.Pavel854 ай бұрын
Thanks for the video, it's very nice solution! about a month or two ago I had to solve a similar problem and now I can compare both solutions :)
@CodeMaze4 ай бұрын
I'm glad you like it. Thank you too for watching the video.
@PankajNikam4 ай бұрын
Thanks for the video, use case of this can be like a video upload service like KZbin. Cool feature to add to this would be reporting real-time progress of the bytes uploaded to the consumer so that they can show a progress bar as to how much is remaining.
@CodeMaze4 ай бұрын
Hi, thanks for watching the video. Your suggestion is great but I think that can be sorted out only on the client app. I have a video about file uploads with Angular and Web API. There, as far as I can remember, this logic is done only on the client side.
@PankajNikam4 ай бұрын
@@CodeMaze I will have to watch that one to understand better. Thanks :)
@aweklin4 ай бұрын
Great video as always!
@CodeMaze4 ай бұрын
Glad you enjoyed! Thank you for watching it.
@MisterKoko6684 ай бұрын
Thank you for the video! In the slide you wrote "With byte[] or MemoryStream, the entire file is loaded into memory before processing" - but that's not the case for MemoryStream, that's a stream, isn't it?
@CodeMaze4 ай бұрын
Hi. Well, MemoryStream != Stream. MemoryStream will create a stream whose backing store is memory. On the other hand Stream is the abstract base class of all streams. A stream is an abstraction of a sequence of bytes, such as a file, an input/output device, an inter-process communication pipe, or a TCP/IP socket. I used some definitions from official documentation but you see the difference.
@MisterKoko6684 ай бұрын
@@CodeMaze Thanks for your reponse! I had the idea that while the backing store is memory, it's still processed as a stream and hence still efficient and won't require loading all of it to memory at once.
@ManojRawat-lp4yc23 күн бұрын
Why didn't you tried interface like IFormFile for uploading a file as use of stream can be done there as well ? Any particular reason for not choosing IFormFile ?
@CodeMaze23 күн бұрын
No special reason, I just didn't need it here, and I can get the body from the request as shown in the video.
@kauavinicius97993 ай бұрын
That code did'nt work for me, i am getting 2 errors: System.IO.InvalidDataException: Multipart body length limit 16384 exceeded. and Unexpected end of Stream, the content may have already been read by another component. Can someone help me ?
@CodeMaze3 ай бұрын
Well, that's pretty hard to say, why is that. It is even more awful to say it works for me, as you can see from the video :) But maybe try this thread: stackoverflow.com/questions/55582335/invaliddataexception-multipart-body-length-limit-16384-exceeded I really can't say what can be the issue. You are probably using my code in your custom solution and something is messing up inside the solution. I don't remember what was the size of that Zip file I used for testing, but it was a large one.
@harrisonwell17194 ай бұрын
If I need to retrieve a lot of images from the directory, Can I Cache them for faster retrieval?
@CodeMaze4 ай бұрын
To be honest, I never had a situation where I had to return a lot of images, it was usually one or two related to the user's profile or product description or something like that, so I never done image caching. I see in ASP.NET Core apps like MVC or Razor you can use the UseStaticFiles method to do that, and I believe it can be done the same with Web API, but again, I really never done that.
@joysamuelkamlomo86844 ай бұрын
What about doing heavy complex calculations, data analysis stuff etc
@CodeMaze4 ай бұрын
I am sorry, calculations and data analysis about what? I am just not sure I understand the comment and how it is related to this video.
@IZ908Ай бұрын
It is not working for 2 gb files. HTTP Error 413.1 - Request Entity Too Large
@CodeMazeАй бұрын
All the resources I found online regarding to this issue are referencing to the max allowed file size limit issue on the server you are using for hosting. So maybe those articles online can help.
@kurdishfreeman75683 ай бұрын
How can I post a file to this endpoint, using HttpClient?
@CodeMaze3 ай бұрын
Hi. You can read this article where I use Blazor WASM with Web API to upload a file code-maze.com/blazor-webassembly-file-upload/
@gidolasajaye92384 ай бұрын
do you have it in the book?
@CodeMaze4 ай бұрын
You can always visit the sales page linked in the descritption window and you will find: "What's inside" section. There you can see the entire TOC from the book and some preview chapters.
@nicoxxxi4 ай бұрын
What is happening with your site? I am receiving some errors
@CodeMaze4 ай бұрын
We had some cache issues, but now everything is back in order. Just hit CTRL+F5 on the page if you still see the issue.
@Miraziz-dotnet4 ай бұрын
Or navigate to main page.
@davestorm67184 ай бұрын
I followed as much as I could, but getting System.InvalidOperationException: Unable to resolve service for type 'UploadingLargeFiles.Services.IFileService' while attempting to activate 'UploadingLargeFiles.Controllers.FileController'. at Microsoft.Extensions.DependencyInjection.ActivatorUtilities.ThrowHelperUnableToResolveService(Type type, Type requiredBy)
@davestorm67184 ай бұрын
oops! I didn't register the service: builder.Services.AddScoped();
@CodeMaze4 ай бұрын
Hi, I just wanted to say this. When you get this type of error it always means there is something wrong with the service registration. Also, the source code is there - part of the patreon membership (for all the videos).