FWRITE() 使用 XAMPP 将文件保存到特定位置
我意识到也有类似的问题,但仅涉及在 Linux 服务器或外部 Windows 服务器上保存文件。我的本地计算机(运行 XAMPP)上的 C:/ 驱动器下有一个脚本。脚本运行后,我想将文件保存到我的计算机网络上的 Z:/ 驱动器,但无法实现此操作。
是否可以让脚本运行:
C:\xampp\htdocs\folder\script.php
并将生成的 .pdf 文件保存发送到:
Z:\文件夹名称2
编辑
虽然我能够运行脚本并将文件存储在 C 驱动器上的任何位置,但我的问题是放在网络共享驱动器(Z 驱动器)上。运行时,我收到以下错误:
警告:fopen(Z:\form.pdf) [function.fopen]:打开失败 流:没有这样的文件或目录 C:\xampp\htdocs\folder\fpdf\fpdf.php 在线 1157 FPDF 错误:无法创建 输出文件:Z:\form.pdf
I realize there are similar questions but only regarding saving files on Linux servers or external windows servers. I have a script on my local machine (running XAMPP) under the C:/ drive. Once the script is run, I would like to save the file to the Z:/ drive on my computer network but am unable to make this happen.
is it possible to have the script run from say:
C:\xampp\htdocs\folder\script.php
and save that .pdf file generated sent to:
Z:\Foldername2
EDIT
While I am able to run the script and store the file anywhere on my C drive, my issue is placing on a network shared drive (the Z drive). When run, I get the following error:
Warning: fopen(Z:\form.pdf)
[function.fopen]: failed to open
stream: No such file or directory in
C:\xampp\htdocs\folder\fpdf\fpdf.php on line
1157 FPDF error: Unable to create
output file: Z:\form.pdf
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
最简单的方法是在您的 Web 目录中放置一个指向该位置的快捷方式,然后确保权限允许 RW 访问
The easiest way is to put a shortcut in your web directory pointing to that location, and then make sure the permissions allow RW access
假设该目录是可写的,您应该能够在 输出 中使用 F 选项方法。
Assuming the directory is writable you should be able to use the F option in the output method.