Php OneUploaderBundle(blueimp)所有文件
我使用了Php OneUploaderBundle(blueimp)所有文件,php,jquery,symfony,oneupuploaderbundle,Php,Jquery,Symfony,Oneupuploaderbundle,我使用了oneuploaderbundle,前面是:jQuery文件上传 现在,我可以上传文件并向实体添加记录,但默认情况下,不会显示所有上传的文件。当我将文件添加到列表并单击“开始上载”时,我可以看到列表中的文件,刷新后,列表被擦除 public function onUpload(PostPersistEvent $event) { $file = $event->getFile(); $response = $event->getRes
oneuploaderbundle
,前面是:jQuery文件上传
现在,我可以上传文件并向实体添加记录,但默认情况下,不会显示所有上传的文件。当我将文件添加到列表并单击“开始上载”时,我可以看到列表中的文件,刷新后,列表被擦除
public function onUpload(PostPersistEvent $event)
{
$file = $event->getFile();
$response = $event->getResponse();
$object = new file();
$object->setFilename($file->getPathName());
$this->manager->persist($object);
$this->manager->flush();
//$files = $this->getFiles($request->files);
$response['files']= array(
array(
'name' => $file->getPathName(),
'url' => $file->getPathName()
)
);
}
我是否需要使用其他方法来响应