fusio icon indicating copy to clipboard operation
fusio copied to clipboard

how to make folder and upload image in sandbox php

Open fictionteamapps opened this issue 3 years ago • 1 comments

What php code to make a new folder with sandbox and upload image file

fictionteamapps avatar Feb 13 '22 22:02 fictionteamapps

Hi, so in general you can use the normal PHP functions to handle file uploads i.e.

move_uploaded_file($body->get('my_file')->tmp_name, '/my/target.tmp')

but in the sandbox action you are restricted to specific functions so using move_uploaded_file is at the sandbox not possible but you could easily create a custom action containing this code. In the next version of Fusio we have improved the upload handling s. https://github.com/apioo/fusio-docs/blob/main/docs/use_cases/file_uploads.md which then makes it also possible to use the upload at the sandbox action.

chriskapp avatar Feb 15 '22 21:02 chriskapp