C#
C#

help

Root Question Message

sydney
sydney9/27/2022
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
Pobiega
Pobiega9/27/2022
uploading huge files via http isn't recommended in general
sydney
sydney9/27/2022
i see.. so it's better to use javascript to upload huge files, is that correct?
Pobiega
Pobiega9/27/2022
how would javascript help?
Pobiega
Pobiega9/27/2022
if you mean by doing axios.PostAsyncor whatever, thats also via http
Pobiega
Pobiega9/27/2022
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 similar
sydney
sydney9/27/2022
i 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..
sydney
sydney9/27/2022
can i understand what approach you usually use to upload a file if using http is not good/fragile?
Pobiega
Pobiega9/27/2022
for a large file? Probably ftp or something
Pobiega
Pobiega9/27/2022
ie, something entirely different
Pobiega
Pobiega9/27/2022
It'd be interesting to see how youtube handles it, since they are pretty much the masters of "giant file upload"
Pobiega
Pobiega9/27/2022
its likely some form of streaming the file directly from the request stream thou
Message Not Public

Sign In and Join Server To See

9/28/2022
Pobiega
Pobiega9/28/2022
That sounds like a very good fit.
sydney
sydney9/28/2022
thank you so much both! i'll try out the library 😊 👍
sydney
sydney9/29/2022
hi @471991791546007572 im trying to follow the tusdotnet documentation on github and saw this snippet code, can we use this in .net framework as well?
Message Not Public

Sign In and Join Server To See

9/29/2022
sydney
sydney9/30/2022
which version of net did you try before for this implementation?
Message Not Public

Sign In and Join Server To See

9/30/2022
sydney
sydney10/1/2022
hmm.. can i have the snippet code of your implementation?
tebeco
tebeco10/1/2022
$upload
Message Not Public

Sign In and Join Server To See

10/1/2022
Message Not Public

Sign In and Join Server To See

10/1/2022
Message Not Public

Sign In and Join Server To See

10/1/2022
tebeco
tebeco10/1/2022
and you'll have to also remove all code not compiling
tebeco
tebeco10/1/2022
like signal
tebeco
tebeco10/1/2022
or loader
tebeco
tebeco10/1/2022
or uploadprogress
tebeco
tebeco10/1/2022
(you can't use that code as/is without cleaning it)
tebeco
tebeco10/1/2022
it's also missing definition for Upload or UploadOptions
tebeco
tebeco10/1/2022
or all the UI related binding
tebeco
tebeco10/1/2022
list selectedFileNames etc ...
tebeco
tebeco10/1/2022
the code is not "self contained", as in, it's not usable without re-writing it
tebeco
tebeco10/1/2022
if all dangling variable / UI related would have beeng function parameter it would have worked
Message Not Public

Sign In and Join Server To See

10/1/2022
tebeco
tebeco10/1/2022
*cloud
tebeco
tebeco10/1/2022
yeah but that is not directly usable 😉
tebeco
tebeco10/1/2022
the code is tied to the UI
tebeco
tebeco10/1/2022
an tip here would be to move that code away from your UI
tebeco
tebeco10/1/2022
parameter everything
tebeco
tebeco10/1/2022
so that your code is portable
tebeco
tebeco10/1/2022
in case tomorrow you need that in another project
tebeco
tebeco10/1/2022
all the callback for error / progress for example
tebeco
tebeco10/1/2022
the input for the file selection also
tebeco
tebeco10/1/2022
the chunk size instead of the 30
Message Not Public

Sign In and Join Server To See

10/1/2022
tebeco
tebeco10/1/2022
or the api endpoint
tebeco
tebeco10/1/2022
👍
tebeco
tebeco10/1/2022
last tips, if you had this as a github link they would not have to retype it all manually
ContactFrequently Asked QuestionsJoin The DiscordBugs & Feature RequestsTerms & Privacy