Use file-specific attachment folder for uploaded images #1928
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.
This is based on #1900.
This is an implementation of a file-specific attachment folder for images. When uploading an image or inserting a link, the created image file is placed in a folder next to the .md file (in the .md file owner's storage). The editor then gets those images via a Text internal API endpoint.
With this solution, image files don't have to be shared anymore. Users having access to the .md file are able to get the attached images even if the files are not explicitly shared with them. When such user uploads or insert a link, the image is then accessible to everyone having access to the .md file.
Same with public access. Access to images and ability to upload or insert a link is now possible.
Permission check is done in both user share and public link contexts. Upload and link insertion are only possible when having write permissions.
Text server side serves previews of the image files.
image/x-ms-bmpandimage/jpgmime types have been added.text://image?imageFileName=plop.jpg&textFileId=1234.