I wrote a plugin. It has function for upload image and show image it via URL.
I uploaded the image and store it in the (tomcat of jira : ../../container/tomcat8x/cargo-jira-home/webapps/jira/images) then the image can be access via URL .../jira/secure/imageName.jpg
But I wonder if the image stored in tomcat is properly right way?
I find so way to store an image in the {JIRA_HOME}/data/... But I don't no the way to access the image via URL.
Does anybody know how to access the image in {JIRA_HOME} via URL?
Hi @IgorUkolov,
I resolve this problem by that way:
- Upload image -> store image in JIRA HOME -> read image from JIRAHOME -> return it to the client via REST
if (FileUtil.isImage(image)) {
String subType = FileUtil.getFileExtension(fileName);
return Response.ok(image).type(new MediaType("image", subType)).build();
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Dang Thi Thuy Tien thanks a lot! Do you know how to don't mark resource as attachment? In other words, I don't want download dialog when I'm trying to access an image via url, I want to show image instead...
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.