我有一个通过ajax将数据发布到控制器的表单。
// Create new upload instance
$upload = Upload::create();
// Create new file instance
$file = File::create();
// Upload the file
$upload->loadIntoFile($fileData, $file, $this->folderName);
// Get the file from the Upload
$uploadedFile = $upload->getFile();
// Get the file from the Upload
$write = $uploadedFile->write();
图像上传成功,但文件未写入文件表。
未报告任何错误。
答案 0 :(得分:0)
这可能是文件未发布的问题?您检查了File
与File_Live
表吗?可能相关的讨论:https://github.com/silverstripe/silverstripe-framework/issues/6048