Zend PDF - 权限问题 [英] Zend PDF - Permission problem

查看:27
本文介绍了Zend PDF - 权限问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个简单的问题,但不知何故我无法解决它.我想创建一个 pdf 文件,因此我尝试了 Zend 提供的示例(此处).当我运行代码时,出现以下错误:PDF 错误:无法打开 'example.pdf' 文件进行写入".我认为问题是权限.但我不知道哪个文件应该获得写权限.我不只是为每个文件提供权限,而是询问是否有人知道我到底需要做什么.

I have a simple problem but somehow I cannot solve it. I want to create a pdf file and therefore I tried the example provided by Zend (here). When I run the code I get the following error: "PDF error: Can not open 'example.pdf' file for writing". I think the problem are the permissions. But I don't know which file should get the write permission. Instead of just providing every file the permission I wanted to ask if anyone knows what exactly I need to do.

推荐答案

将保存文件的路径更改为类似这样的内容并使目录可写.

Change the path of the saved file to something like this and make the directory writable.

$pdf->save('path/to/example.pdf');

如果您希望能够覆盖文件,请使用以下内容:

If you want to be able to overwrite the file use the following:

$pdf->save('path/to/example.pdf', TRUE);

这篇关于Zend PDF - 权限问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆