[xwiki-users] How to attach and deattach file by code
I have a document with a input type="file" and a submit button. After I click submit button, the following action is performed: - attach the file to the document - do something with the file content... - deattach the file out of the document Can I reuse the action /xwiki/bin/upload/.. to write my action ?
I have already known how to do that. I have another question: I have a form with 3 file inputs and an "Attach" button. After click this button, 3 files are attached to the current document. How can I do this using the XWiki action /xwiki/bin/upload ?. I tried but only 1 file is allowed.
Ngo Thi Hong Nga wrote:
I have already known how to do that. I have another question: I have a form with 3 file inputs and an "Attach" button. After click this button, 3 files are attached to the current document. How can I do this using the XWiki action /xwiki/bin/upload ?. I tried but only 1 file is allowed. ------------------------------------------------------------------------
_______________________________________________ users mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/users
Hi, Could you share your solution to the first question with the community? It will be useful at least for me myself! Thanks! Cheers, -- Ricardo Rodríguez Your EPEC Network ICT Team
My solution sounds silly but it works :) Assume that the upload document is named XWiki.Upload. In this document, I change the value of the hidden field "xredirect" to XWiki.DoSomething. I create another document named XWiki.DoSomething, in it, write some code to deal with the file content, blah ... , finally, redirect back to XWiki.Upload.
Ngo Thi Hong Nga wrote:
My solution sounds silly but it works :) Assume that the upload document is named XWiki.Upload. In this document, I change the value of the hidden field "xredirect" to XWiki.DoSomething. I create another document named XWiki.DoSomething, in it, write some code to deal with the file content, blah ... , finally, redirect back to XWiki.Upload. Thanks!
-- Ricardo Rodríguez Your EPEC Network ICT Team
participants (2)
-
[Ricardo Rodriguez] Your EPEC Network ICT Team -
Ngo Thi Hong Nga