FWRITE() 使用 XAMPP 将文件保存到特定位置

发布于 2024-10-05 09:58:04 字数 561 浏览 0 评论 0原文

我意识到也有类似的问题,但仅涉及在 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

爱你不解释 2024-10-12 09:58:05

最简单的方法是在您的 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

春夜浅 2024-10-12 09:58:04

假设该目录是可写的,您应该能够在 输出 中使用 F 选项方法。

Assuming the directory is writable you should be able to use the F option in the output method.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文