Returning Observer

Create temp files in service


I have the following problem:

I want to create an upload hook, that takes a zip file and if this zip file is in a certain directory and the upload hook is acitvated, I want to unzip the complete zip file and upload the entries as media in FS.

Because the zip file can be pretty big, I want to do the actual unzip and upload of the entries not in my upload hook but in a service. To upload them as media I have to create temp files and of course I want to create those zip files on the server, not on the local machine of the user. How would I do that?

I saw that there is a getDataDir() in the serverEnvironment, but I only get FS FileHandles there. How would I work with those to create my  temp files?

Or is there some other way that I am not seing?

Best regards,


0 Kudos
0 Replies