Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
当文件通过表单上传时,它的位置是网络服务器可写但不在当前应用程序文件夹中的位置。我喜欢这个的原因是:
保存文件时有没有办法通过 TCPDF 访问这个位置?
如果您想使用上传结束的相同位置:
$tmp = ini_get('upload_tmp_dir');
但是无论如何你都应该使用sys_get_temp_dir()and'/tmp'作为后备。
sys_get_temp_dir()
'/tmp'
而且您知道,只需将其作为参数传递给您的保存函数$TCPDF->Output("$tmp/file.pdf", "F");
$TCPDF->Output("$tmp/file.pdf", "F");