Editor / Filestore / Add possibility to upload file from URL#8794
Open
fxprunayre wants to merge 1 commit intomainfrom
Open
Editor / Filestore / Add possibility to upload file from URL#8794fxprunayre wants to merge 1 commit intomainfrom
fxprunayre wants to merge 1 commit intomainfrom
Conversation
juanluisrp
requested changes
May 15, 2025
Contributor
juanluisrp
left a comment
There was a problem hiding this comment.
I haven't tested how it works, but Sonarqube is complaining about the use of a deprecated method. I've added a change suggestion.
core/src/main/java/org/fao/geonet/api/records/attachments/AbstractStore.java
Show resolved
Hide resolved
bed2cf1 to
7e58b80
Compare
|
josegar74
reviewed
Sep 10, 2025
| filename = ContentDisposition.parse(contentDisposition).getFilename(); | ||
| } | ||
| // If follow redirect, get the filename from the redirected URL | ||
| if (filename == null && connection.getInstanceFollowRedirects()) { |
Member
There was a problem hiding this comment.
Some questions:
- Should not check also for empty value, like in line 242?
- Should not change line 242 to use
else if ....?
Member
Author
There was a problem hiding this comment.
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.
Use the existing API to upload a file in the store from a URL. Improve file naming in case of redirect.
7e58b80 to
18ac23d
Compare
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Use the existing API to upload a file in the store from a URL.
Also improve file naming in case of redirect. eg. Microsoft datalake does not provide
content-dispositionheader 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
mainbranch, backports managed with labelREADME.mdfilespom.xmldependency management. Update build documentation with intended library use and library tutorials or documentationFunded by EEA