Server side scripting & local file storage


#1

Hello !
I am trying something new using a server side sccripting:

I want to create a file, but the user can’t know where it is in the server,
so what I am currently doing is that:

  • I post a file to rest/files/container/fake/path

  • and into the script files.container.post.pre_process, I make something like

    event.request_path = "rest/files/container/real/path";

But in the end, the new file is created in rest/files/container/fake/path

Is it possible to change the path the file will be saved once in the post.pre_process script ?
If so, how can I do that ?

If it is not the good way to do that, how can I do it ?

Cheers :smile:


#2

Well…
I bump this question because it is a kinda important one for me…
Maybe it is something I didn’t understood or saw in the server side scripting documentation:

How can I change a event parameter such as request_path in order for it to be changed in the processing of the request ?


#3

So,
what I did was a custom script to be used as a web service.
And this web service compute the real path and then call the platform.api.post(‘files/container/real/path’, data)

and it works!