Aller au contenu principal

Modifying uploads

Commentaires

3 commentaires

  • Zendesk API User
    Author: philippr - 3/23/2016 8:54

    Hi Martin,

    you can use an upload hook (de.espirit.firstspirit.service.mediamanagement.UploadHook):

    Or a a StoreListener might help (de.espirit.firstspirit.access.store.StoreListener).

    Regards,

    Philipp

    0
  • Zendesk API User
    Author: mheiden - 3/31/2016 9:56

    Hi Philipp,

    you mean by modifying the File that I get when

    public void preProcess(@NotNull final BaseContext baseContext, @NotNull final Media media, @NotNull final File file, @NotNull final InputStream inputStream, final long length) throws UploadRejectedException, IOException {
        }

    is called?

    I didn't find and example in the documententation which describes the modification of medias, all the parameters are declared as final and the method is void... That didn't seem to be intended for modification. I know that only the reference to the "final File" is immutable.

    I would expect that the api has a method with a return value when someone shall be able to change something.

    I'll give it a try.

    Thanks,

      Martin.

    0
  • Zendesk API User
    Author: mheiden - 4/1/2016 15:26

    Okay, solved it. But it is quite ugly.

    I used the postProcess-Method, but I had to keep a static Reference to the Media I worked on to prevent a StackOverflow. The UploadHook was triggered again when I called setFile on the File-Argument.

    0

Vous devez vous connecter pour laisser un commentaire.