Skip to content

Editor / Filestore / Add possibility to upload file from URL#8794

Open
fxprunayre wants to merge 1 commit intomainfrom
44-editorfileuploadfromurl
Open

Editor / Filestore / Add possibility to upload file from URL#8794
fxprunayre wants to merge 1 commit intomainfrom
44-editorfileuploadfromurl

Conversation

@fxprunayre
Copy link
Copy Markdown
Member

Use the existing API to upload a file in the store from a URL.

image

Also improve file naming in case of redirect. eg. Microsoft datalake does not provide content-disposition header https://discodata.eea.europa.eu/download/AirQualityIndicators/latest/hra_pm25_EU_SDG_11_52 fallback on using the redirected URL to build the file name.

Checklist

  • I have read the contribution guidelines
  • Pull request provided for main branch, backports managed with label
  • Good housekeeping of code, cleaning up comments, tests, and documentation
  • Clean commit history broken into understandable chucks, avoiding big commits with hundreds of files, cautious of reformatting and whitespace changes
  • Clean commit messages, longer verbose messages are encouraged
  • API Changes are identified in commit messages
  • Testing provided for features or enhancements using automatic tests
  • User documentation provided for new features or enhancements in manual
  • Build documentation provided for development instructions in README.md files
  • Library management using pom.xml dependency management. Update build documentation with intended library use and library tutorials or documentation

Funded by EEA

@fxprunayre fxprunayre added this to the 4.4.8 milestone May 15, 2025
@fxprunayre fxprunayre requested a review from josegar74 May 15, 2025 13:16
Copy link
Copy Markdown
Contributor

@juanluisrp juanluisrp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I haven't tested how it works, but Sonarqube is complaining about the use of a deprecated method. I've added a change suggestion.

@fxprunayre fxprunayre force-pushed the 44-editorfileuploadfromurl branch from bed2cf1 to 7e58b80 Compare May 16, 2025 05:42
@sonarqubecloud
Copy link
Copy Markdown

@josegar74 josegar74 modified the milestones: 4.4.8, 4.4.9 May 28, 2025
filename = ContentDisposition.parse(contentDisposition).getFilename();
}
// If follow redirect, get the filename from the redirected URL
if (filename == null && connection.getInstanceFollowRedirects()) {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some questions:

  1. Should not check also for empty value, like in line 242?
  2. Should not change line 242 to use else if .... ?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1

Added, but I suppose when we get a redirect filename is not set.

2

We want to get the filename from

  • content disposition
  • from redirectUrl
  • from fileUrl
    depending on what is set in that order. So it should be ok.

@jahow jahow modified the milestones: 4.4.9, 4.4.10 Oct 7, 2025
Use the existing API to upload a file in the store from a URL.
Improve file naming in case of redirect.
@fxprunayre fxprunayre force-pushed the 44-editorfileuploadfromurl branch from 7e58b80 to 18ac23d Compare March 27, 2026 07:05
@sonarqubecloud
Copy link
Copy Markdown

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants