简体   繁体   English

vich_uploader.download_handler / StreamedResponse获取文件而不是响应

[英]vich_uploader.download_handler / StreamedResponse get file instead of response

I try get file from FTP filesystem 我尝试从FTP文件系统获取文件

 $this->container->get('vich_uploader.download_handler')->downloadObject($file,'file');

this return StreamedResponse 此返回StreamedResponse

How i can get file instead of stream, there exist method in vich_uploader get file ? 我如何获取文件而不是流,vich_uploader中存在获取文件的方法?

(I must download file from ftp storage and create new file localy so need binary and put it as new file) (我必须从ftp存储下载文件并在本地创建新文件,因此需要二进制文件并将其作为新文件放置)

ok, it is easy from gaufrette 好的,从gaufrette很容易

  $filesystem = $this->container->get('gaufrette.product_uploads_ftp_fs_filesystem');

$filesystem->read($file->getOriginalName())

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM