I'm migrating a custom plugin from 4.4.x to 5.2.5 and one of the things we do in this plugin is provide the ability to attach files at the project level. We support this project attachment through ActiveObject and don't rely on any of the built in issue attachment capabilities. Javascript changes between these version include validating that the attachment is less than the JIRA upload size limit and that the uploaded files are associated with an existing issue. The js code also converts the input type="file" element to a checkbox for multiple file uploads.
I'm not providing a different way to create issue attachments. So, the restriction to match an issue id is not applicable. I'm only allowing the user to upload a single file at a time so I don't want to support multiple files. The file upload restriction set in JIRA also doesn't apply and I don't want that validation.
I want to disable all of this new functionality for the custom project attachment form I'm migrating but leave it in place for the standard issue attachment forms. I don't want to modify the out of the box javascript files. Is there a way to do this without editing source js code? If not, why not?
Community moderators have prevented the ability to post new answers.
By reviewing the javascript code I noticed this in initInlineAttach.js:
function createInlineAttach(context) { context.find("input[type=file]:not('.ignore-inline-attach')").inlineAttach(); }
That is what I needed. By simply adding
class="ignore-inline-attach"
to my input type="file" element all of this functionaltiy is turned off.
I hope this helps someone else!
Hey @Bart, can you plz help me with the java code for fileupload in JiraWebActionSupport. I am using MultiPartRequestWrapper , but it's null.
Thanks in Adv.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Vikash,
If you provide more details about the issue you're having on the server side I or someone else may be able to help you. You may want to start a new question that is about the server side of uploading files in JIRA plugins.
Bart
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hey @Bart, i have posted a new question at below link. Will you plz provide your valuable input.
why file upload into jira request is text/html instead of multipart/form-data? - Atlassian Answers
Thanks,
Vikash
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Here is what I find out after a day researching...
http://stackoverflow.com/questions/15761800/single-file-upload-in-jira
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Just for note if you ever need to support multiple uploads:
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.
Hi Timothy ,
How to get object of TemporaryAttachmentsMonitor in my action class.?
Thanks in adv.
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.