OrchardCore icon indicating copy to clipboard operation
OrchardCore copied to clipboard

Handle MaxFileSize in javascript

Open deanmarcussen opened this issue 6 years ago • 7 comments

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)

deanmarcussen avatar Jul 23 '19 08:07 deanmarcussen

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

hishamco avatar Aug 10 '19 15:08 hishamco

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.

deanmarcussen avatar Aug 10 '19 17:08 deanmarcussen

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

hishamco avatar Aug 10 '19 17:08 hishamco

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.

DrewBrasher avatar Nov 18 '22 18:11 DrewBrasher

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

Skrypt avatar Nov 19 '22 15:11 Skrypt

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

sebastienros avatar Dec 01 '22 18:12 sebastienros

@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?

DrewBrasher avatar Dec 01 '22 19:12 DrewBrasher