Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support long type MaxFileSize in MediaOptions? #17309

Open
engine5d opened this issue Jan 6, 2025 · 9 comments
Open

Support long type MaxFileSize in MediaOptions? #17309

engine5d opened this issue Jan 6, 2025 · 9 comments
Milestone

Comments

@engine5d
Copy link

engine5d commented Jan 6, 2025

Is your feature request related to a problem?

There are some huge size file more than 2GB, we 'd like to upload media library, but mediaoptions maxFileSize number only set as type int32.

Describe the solution you'd like

Could you give a long type of MaxFileSize in MediaOptions

Describe alternatives you've considered

Copy link
Contributor

github-actions bot commented Jan 6, 2025

Thank you for submitting your first issue, awesome! 🚀 We're thrilled to receive your input. If you haven't completed the template yet, please take a moment to do so. This ensures that we fully understand your feature request or bug report. On what happens next, see the docs.

If you like Orchard Core, please star our repo and join our community channels.

@hishamco
Copy link
Member

hishamco commented Jan 6, 2025

There are some huge size file more than 2GB

Really?! I might never have seen any managed by CMS before. @Piedone, did you come across such a situation in DotNest?

@Piedone
Copy link
Member

Piedone commented Jan 6, 2025

Not as users asking for it, but I don't know if anybody tried to upload larger files.

But I guess while changing the type itself should be fine (and even backward compatible), I'd be conscious about the following when allowing such large files:

  • Do we have cases where the uploaded files are loaded into memory as-is? That could cause out of memory exceptions.
  • The upload UI doesn't really help with long uploads. There's no progress bar or a way to resume interrupted uploads.
  • The process should be run as 64b.
  • MaxUploadChunkSize should be set to a value supported by the platform.

@engine5d
Copy link
Author

engine5d commented Jan 7, 2025

Not as users asking for it, but I don't know if anybody tried to upload larger files.

But I guess while changing the type itself should be fine (and even backward compatible), I'd be conscious about the following when allowing such large files:

  • Do we have cases where the uploaded files are loaded into memory as-is? That could cause out of memory exceptions.
  • The upload UI doesn't really help with long uploads. There's no progress bar or a way to resume interrupted uploads.
  • The process should be run as 64b.
  • MaxUploadChunkSize should be set to a value supported by the platform.

I'm glad to support this feature.

We are using OrchardCore to build an intranet CMS solution, including a engineering document management module. providing hierarchical data management , big 3d model file management etc.

@Piedone
Copy link
Member

Piedone commented Jan 7, 2025

I'd suggest you start a draft PR along the lines of what I've written above, and then we can see if it's a suitable approach going forward.

@sebastienros
Copy link
Member

This should just work by changing the type in code. Please try to change it and verify it works in a PR.

@sebastienros sebastienros modified the milestones: 3.0, 3.x Jan 9, 2025
Copy link
Contributor

github-actions bot commented Jan 9, 2025

We triaged this issue and set the milestone according to the priority we think is appropriate (see the docs on how we triage and prioritize issues).

This indicates when the core team may start working on it. However, if you'd like to contribute, we'd warmly welcome you to do that anytime. See our guide on contributions here.

1 similar comment
Copy link
Contributor

github-actions bot commented Jan 9, 2025

We triaged this issue and set the milestone according to the priority we think is appropriate (see the docs on how we triage and prioritize issues).

This indicates when the core team may start working on it. However, if you'd like to contribute, we'd warmly welcome you to do that anytime. See our guide on contributions here.

@MikeAlhayek
Copy link
Member

MikeAlhayek commented Jan 21, 2025

You should be able to represent 2GB using int. The FormOptions also uses int, so even if we change MaxFileSize type, I think ASP.NET Core app would prevent you from allowing the upload.

Try the following and see if this will allow you to upload the 2GB file. (obviously use with caution as this could crash your app if you are not careful)

services.Configure<FormOptions>(options =>
{
    options.ValueCountLimit = int.MaxValue;
    options.ValueLengthLimit = int.MaxValue;
});

service.PostConfigure<MediaOptions>(options =>
{
    options.MaxFileSize =int.MaxValue;
});

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants