upload file that have huge size using asp net framework form
hi all, i understand that we can't upload file to a form with size larger than 2GB using asp net (reference from this link https://www.webdavsystem.com/server/documentation/large_files_iis_asp_net/), can i understand.. do we need to upload the file in chunk using JavaScript to pass the content to our controller?
i found an article, im not sure if this is the right approach using javascript.. https://www.dotnetbull.com/2018/09/uploading-large-file-chunks-javascript-ajax-mvc-dotnet.html?m=1
16 Replies
uploading huge files via http isn't recommended in general
i see.. so it's better to use javascript to upload huge files, is that correct?
how would javascript help?
if you mean by doing
axios.PostAsync
or whatever, thats also via http
I've never had to implement a "users can upload giant files" thing myself, so I'm no expert on the subject.. but http transfers are a bit fragile and there is no resume functionality or similari see.. actually im not sure what we should use to upload large files, i tried using asp net and upload huge file into the form, the page just not responding for a very long time and end up crash..
can i understand what approach you usually use to upload a file if using http is not good/fragile?
for a large file? Probably ftp or something
ie, something entirely different
It'd be interesting to see how youtube handles it, since they are pretty much the masters of "giant file upload"
its likely some form of streaming the file directly from the request stream thou
Unknown User•3y ago
Message Not Public
Sign In & Join Server To View
That sounds like a very good fit.
thank you so much both! i'll try out the library 😊 👍
hi @ybear im trying to follow the tusdotnet documentation on github and saw this snippet code, can we use this in .net framework as well?
Unknown User•3y ago
Message Not Public
Sign In & Join Server To View
which version of net did you try before for this implementation?
Unknown User•3y ago
Message Not Public
Sign In & Join Server To View
hmm.. can i have the snippet code of your implementation?
Unknown User•3y ago
Message Not Public
Sign In & Join Server To View
In case you did not read the docs:
https://docs.microsoft.com/en-us/aspnet/core/mvc/models/file-uploads?view=aspnetcore-6.0
Client Code:
ServerCode:
The field's name in the body when doing the POST, needs to match the binded field in the Controler's Action
https://media.discordapp.net/attachments/569261465463160900/1001188081069735936/unknown.png
Upload files in ASP.NET Core
How to use model binding and streaming to upload files in ASP.NET Core MVC.
Unknown User•3y ago
Message Not Public
Sign In & Join Server To View