我正在写一个请求其他DF服务的PHP脚本,这是一个FileStorage。当我请求包含该文件的文件夹时,响应是正确的,但当我想直接请求一个文件(json或xml)时,会出现一个错误:
DF日志:
local.ERROR: Type error: Argument 1 passed to DreamFactory\Core\Utility\ResponseFactory::sendScriptResponse() must implement interface DreamFactory\Core\Contracts\ServiceResponseInterface, instance of Symfony\Component\HttpFoundation\StreamedResponse given, called in D:\socle_64\dreamfactory-2.12.0\apps\dreamfactory\htdocs\vendor\dreamfactory\df-script\src\Components\BaseEngineAdapter.phpPHP脚本如下所示:
$platform['api']->get->__invoke('service/file');当我只将路径传递到包含该文件的文件夹时,它工作得很好。同样的请求通过邮递员或在我的DF服务之外工作得很好。
谢谢
附言:对不起,我的英语。
发布于 2019-03-21 18:00:27
好吧,我找到了问题的解决方案:
$result = $platform['api']->get->__invoke('service/file.txt?include_properties=true&content=true');=>返回base64编码的文件内容
$file = base64_decode($response['content'], true);https://stackoverflow.com/questions/55276512
复制相似问题