apache / dolphinscheduler

Apache DolphinScheduler is the modern data orchestration platform. Agile to create high performance workflow with low-code
https://dolphinscheduler.apache.org/
Apache License 2.0
12.88k stars 4.63k forks source link

[Bug] [Resource] Failed to upload file #16346

Closed JohnZp closed 3 months ago

JohnZp commented 4 months ago

Search before asking

What happened

The bug is that when re uploading files, it will prompt file extension cannot not change image

What you expected to happen

work well

How to reproduce

image

Anything else

No response

Version

dev

Are you willing to submit PR?

Code of Conduct

SbloodyS commented 4 months ago

Please provide reproduce steps and deployment environment. I can not reproduce this issue locally.

JohnZp commented 4 months ago

Please provide reproduce steps and deployment environment. I can not reproduce this issue locally.

The second bug is a security interception issue, not a problem with the dolphinscheduler. I have already removed it. The first bug occurred when the wrong method was used to retrieve the file name when re uploading the problem code. Maybe it should like this

        if (!Objects.equals(
                Files.getFileExtension(
                        file.getOriginalFilename() == null ? file.getName() : file.getOriginalFilename()),
                Files.getFileExtension(updateFileDto.getFileAbsolutePath()))) {
            throw new ServiceException("file extension cannot not change");
        }
SbloodyS commented 4 months ago

Did you mean reupload function error? @JohnZp

JohnZp commented 4 months ago

Did you mean reupload function error? @JohnZp

yes

SbloodyS commented 4 months ago

The second bug is a security interception issue, not a problem with the dolphinscheduler. I have already removed it. The first bug occurred when the wrong method was used to retrieve the file name when re uploading the problem code. Maybe it should like this

        if (!Objects.equals(
                Files.getFileExtension(
                        file.getOriginalFilename() == null ? file.getName() : file.getOriginalFilename()),
                Files.getFileExtension(updateFileDto.getFileAbsolutePath()))) {
            throw new ServiceException("file extension cannot not change");
        }

I've reproduce this error successfully. You got it. Would you like to fix it? @JohnZp