Thanks Marius and Guillaume, adding the hidden field seems to work fine!
>________________________________ > Von: Marius Dumitru Florea <[email protected]> >An: XWiki Users <[email protected]> >Gesendet: 11:37 Dienstag, 13.März 2012 >Betreff: Re: [xwiki-users] attachments upload from within form editing > >On Tue, Mar 13, 2012 at 11:26 AM, Guillaume Lerouge <[email protected]> >wrote: >> Hi Olaf, >> >> this is most likely linked to XWiki's CSRF protection feature: >> http://jira.xwiki.org/browse/XWIKI-6773 >> http://lists.xwiki.org/pipermail/devs/2011-October/048647.html >> > >> I can't seem to find a documentation of how to work with it so that your >> requests are considered valid. Can someone else provide a pointer? > >Adding a hidden input field with the CSRF token to your form should be >enough. See >https://github.com/xwiki/xwiki-platform/blob/master/xwiki-platform-core/xwiki-platform-web/src/main/webapp/templates/edit.vm#L66 > >Hope this helps, >Marius > >> >> Another option is to deactivate CSRF protection for the time being (by >> editing xwiki.cfg or xwiki.properties I guess). >> >> Guillaume >> >> On Mon, Mar 12, 2012 at 18:00, O Voss <[email protected]> wrote: >> >>> Hi again, >>> >>> I successfully tweaked the Attachment Selector Macro on my development >>> machine which still runs xwiki 3.1. >>> >>> When trying to do the same (actually when trying to use the Attachment >>> Selector Macro at all) on another machine which runs xwiki 3.4 I run into >>> trouble though: As soon as I click upload and select in the attachment >>> selector, I get an error message: "This request contains an invalid >>> authentication information". >>> >>> Looks like this is http://jira.xwiki.org/browse/XWIKI-7584 in a slightly >>> different flavour. >>> >>> Any hints/workarounds, anyone? >>> >>> >>> Cheers, >>> >>> Olaf >>> >>> >>> >>> >>> >________________________________ >>> > Von: O Voss <[email protected]> >>> >An: XWiki Users <[email protected]> >>> >Gesendet: 13:45 Samstag, 10.März 2012 >>> >Betreff: Re: [xwiki-users] attachments upload from within form editing >>> > >>> >Never mind, I found it myself in the meantime. :-) >>> > >>> >It's in the WikiMacroClass object attached to the AttachmentSelector >>> document. >>> > >>> >Cheers, >>> > >>> > >>> >Olaf >>> > >>> > >>> > >>> > >>> >>________________________________ >>> >> Von: O Voss <[email protected]> >>> >>An: XWiki Users <[email protected]> >>> >>Gesendet: 13:22 Freitag, 9.März 2012 >>> >>Betreff: Re: [xwiki-users] attachments upload from within form editing >>> >> >>> >>Hi again, >>> >> >>> >>I'm nearly there. The last thing I want to tweak is suppressing the >>> display of the selected attachment next to the button. No matter how hard I >>> looked I couldn't find the location where this is handled. >>> >> >>> >>Any hints? >>> >> >>> >>Cheers, >>> >> >>> >>Olaf >>> >> >>> >> >>> >> >>> >> >>> >>>________________________________ >>> >>> Von: O Voss <[email protected]> >>> >>>An: Guillaume Lerouge <[email protected]>; XWiki Users < >>> [email protected]> >>> >>>Gesendet: 9:11 Donnerstag, 8.März 2012 >>> >>>Betreff: Re: [xwiki-users] attachments upload from within form editing >>> >>> >>> >>>Hi Guillaume, >>> >>> >>> >>>Thanks a lot, it looks like I can use that and adapt it to my needs. >>> (It's doing a bit too much for me.) >>> >>> >>> >>>Cheers, >>> >>> >>> >>>Olaf >>> >>> >>> >>> >>> >>> >>> >>> >>> >>>>________________________________ >>> >>>> Von: Guillaume Lerouge <[email protected]> >>> >>>>An: O Voss <[email protected]>; XWiki Users <[email protected]> >>> >>>>Gesendet: 10:18 Dienstag, 6.März 2012 >>> >>>>Betreff: Re: [xwiki-users] attachments upload from within form editing >>> >>>> >>> >>>> >>> >>>>Hi Olaf, >>> >>>> >>> >>>>looks like this is what you're looking for: >>> >>>> >>> http://extensions.xwiki.org/xwiki/bin/view/Extension/Attachment+Selector+Macro >>> >>>> >>> >>>> >>> >>>>Guillaume >>> >>>> >>> >>>> >>> >>>>On Tue, Mar 6, 2012 at 9:02 AM, O Voss <[email protected]> >>> wrote: >>> >>>> >>> >>>>Hi, >>> >>>>> >>> >>>>>I need to find a solution for offering a way to the users to upload >>> attachments to certain pages directly from the form editing mode. (Instead >>> of having to build the page first, save it and attach the file later. >>> Reason: the page is basically just a wrapper for the attached document(s), >>> so it is very counter-intuitive to have to build the wrapper BEFORE you can >>> upload in this case.) >>> >>>>> >>> >>>>>Another way to describe what I need using the FAQ tutorial ( >>> http://platform.xwiki.org/xwiki/bin/view/DevGuide/FAQTutorial): Imagine >>> you want to allow users to attach screenshots to FAQs directly when >>> defining an FAQ. So you probably need to change the document sheet in such >>> a way that in form editing mode a file upload selector is shown below the >>> answer and question fields (that part is easy simply using HTML) and when >>> saving the selected file is uploaded as an attachment to the current page >>> (the tricky part I guess, I have no clue how to start). Allowing to upload >>> multiple files at once would be nice, but isn't an absolute must. >>> >>>>> >>> >>>>>Is this possible? Any hints are greatly appreciated! >>> >>>>> >>> >>>>>Cheers, >>> >>>>> >>> >>>>>Olaf >>> >>>>>_______________________________________________ >>> >>>>>users mailing list >>> >>>>>[email protected] >>> >>>>>http://lists.xwiki.org/mailman/listinfo/users >>> >>>> >>> >>>> >>> >>>_______________________________________________ >>> >>>users mailing list >>> >>>[email protected] >>> >>>http://lists.xwiki.org/mailman/listinfo/users >>> >>> >>> >>> >>> >>> >>> >>_______________________________________________ >>> >>users mailing list >>> >>[email protected] >>> >>http://lists.xwiki.org/mailman/listinfo/users >>> >> >>> >> >>> >> >>> >_______________________________________________ >>> >users mailing list >>> >[email protected] >>> >http://lists.xwiki.org/mailman/listinfo/users >>> > >>> > >>> > >>> _______________________________________________ >>> users mailing list >>> [email protected] >>> http://lists.xwiki.org/mailman/listinfo/users >>> >> _______________________________________________ >> users mailing list >> [email protected] >> http://lists.xwiki.org/mailman/listinfo/users >_______________________________________________ >users mailing list >[email protected] >http://lists.xwiki.org/mailman/listinfo/users > > > _______________________________________________ users mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/users
