OrchardCMS / OrchardCore

Orchard Core is an open-source modular and multi-tenant application framework built with ASP.NET Core, and a content management system (CMS) built on top of that framework.
https://orchardcore.net
BSD 3-Clause "New" or "Revised" License
7.35k stars 2.37k forks source link

Handle MaxFileSize in javascript #3962

Open deanmarcussen opened 5 years ago

deanmarcussen commented 5 years ago

Related to https://github.com/OrchardCMS/OrchardCore/pull/3961 and https://github.com/OrchardCMS/OrchardCore/issues/3263

We could update the media app to use jquery.fileupload-validate.js to validate the max file size before trying to upload to the server.

Will give a better error to the user, regardless of the hosting option (InProcess, OutOfProcess, IIS, Kestrel etc)

hishamco commented 5 years ago

Is anyone started on this or can I make a PR for it?

deanmarcussen commented 5 years ago

I haven't, so unless anyone else has started on it, go for it 😄

I noticed the other day that it doesn't use the bootstrap alert modals you did, when deleting items, so if you're up for it, that'd be cool too.

hishamco commented 5 years ago

Sure

I noticed the other day that it doesn't use the bootstrap alert modals you did, when deleting items, so if you're up for it, that'd be cool too.

I will have a look to this too

DrewBrasher commented 1 year ago

I think this would be a helpful addition. I've had multiple times where a user was trying to upload a file and it just wouldn't upload and didn't give them any indication of why.

Skrypt commented 1 year ago

We need to find something else that doesn't use JQuery.

sebastienros commented 1 year ago

@DrewBrasher if you have ideas and time to improve it feel free to work on that, would be great

DrewBrasher commented 1 year ago

@sebastienros After looking into issue https://github.com/OrchardCMS/OrchardCore/issues/12842 I'm not sure I understand the original intent of this issue. My comment above was because for me, using the attached media editor, no error was getting displayed at all. After testing with the media library instead of the attached editor I see that in the media library, the file too large error does get displayed. image

So fixing the issue with the Upload Vue component mentioned here https://github.com/OrchardCMS/OrchardCore/issues/12842#issuecomment-1330712769 for the attached editor so that it displays the same as the media library would be enough for what I need. I'm not sure though if that would address the original issue here. The uploader does try to upload the file and only shows the error after the server rejects it. So is the issue here that it should show an error before even trying to upload it?