Upload a file from plugin to FileUpload field form

Confluence User - 07 Mar, 2023

Hello everyone, I'm new here.

I have several days trying to upload a file from a plugin and I can't get with the result expected. In some how I'm trying to emulate the fileupload from a plugin.

Here the scenario:

I have a form with a FileUpload field and works ok. When I upload form the field, the file is stored into app_tempfile directory. Then, when I submit the form, the file is moved to app_formuploads directory. Here is correct.


Now, in some cases, I need to upload the file from a plugin. I mean, when the form is showed the FileUpload field is already filled with the file. And the behavior must be the same. That is, move the file into app_formuploads after submit. 

Ok, in my solution. I can upload the file into the app_tempfile directory and the file appears on FileUpload field but I think I missed something because when I submit the form the file is always on app_tempfile directory and don't move to app_formuploads. I think I need to add the file into some tempFilePathMap or something but I didn't got it.

I need to know how FileUpload field works, where is the reference map where matching the filename in the field and the real file stored on disk.

If some of you have the ideas that will help me a lot.


Thank you

fileupload;forms;plugins

1


08 Mar, 2023
confluenceUser
confluenceUser
RELATED QUESTIONS

Your answer


To answer a question you'll need an account.

Print