我们使用 TYPO3 Flow 2.3 集成资源对象来上传我们项目中的任何类型的文件。我们File
对象中的定义是:
/**
* @var \TYPO3\Flow\Resource\Resource
* @ORM\ManyToOne
*/
protected $originalresource;
流畅的调用如下:
<a class="filelink" data-icon="{file.filetype}" href="{f:uri.resource(resource: file.originalresource)}" target="_blank">{file.name}</a>
这个星座中的所有内容都可以正常工作,直到用户上传文件而不以hosts
. 服务器Not Found
以常规 Apache 错误样式显示。是否支持没有结尾的文件?为什么会这样?
设置是:
TYPO3:
Flow:
resource:
storages:
defaultPersistentResourcesStorage:
storage: 'TYPO3\Flow\Resource\Storage\WritableFileSystemStorage'
storageOptions:
path: '%FLOW_PATH_DATA%Persistent/Resources/'
targets:
localWebDirectoryPersistentResourcesTarget:
target: 'TYPO3\Flow\Resource\Target\FileSystemSymlinkTarget'
targetOptions:
path: '%FLOW_PATH_WEB%_Resources/Persistent/'
baseUri: '_Resources/Persistent/'
并且为hosts
文件创建的符号链接_Resources/Persistent/
用哈希命名,然后是一个没有文件结尾的点,指向实际文件。实际文件存在。