UploadFormat and annotations

142 Views Asked by At

Now that the UploadFormat class is available, I have one question about it :

Is the Upload format compatible with Restler annotations ? If yes : how to use it ? "@param file $file" ?

If no : So I don't understand the meaning of this class. How to handle files if we can't receive them in the API methods ?

Thank you anyway for your awesome framework, there are still some work to do to reach perfection but it makes me happy to use a REST api with Swagger-ui

1

There are 1 best solutions below

0
On

Type that parameter as an array. UploadFormat uses the same format as the files in $_FILES associative array for giving you the uploaded file info

You should use this information and handle the upload error and success situations yourself in the api method

You have to move the temp file to an accessible directory to save the file permanently.