0

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

JM4
  • 6,740
  • 18
  • 77
  • 125

2 Answers2

1

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

Paul Norman
  • 1,621
  • 1
  • 9
  • 20
  • @Paul Norman - i've been running into issues using F output method when writing to a network destination drive. For some reason, I am getting a write error. I can write ANYWHERE I want on my C drive but writing to my Z drive prompts the error listed in the edit above. – JM4 Dec 01 '10 at 17:53
  • What exactly is z:\? Is it a mapped network drive, a local disk or a removable drive? Can you read / write from / to it without fpdf? It might be worth checking its permissions closely. – Paul Norman Dec 01 '10 at 18:13
  • It is a mapped network drive, I can read and write to it when access from explorer browser – JM4 Dec 01 '10 at 18:13
  • Hopefully this post will help! http://stackoverflow.com/questions/2592910/php-mapped-network-drives – Paul Norman Dec 01 '10 at 18:18
  • @Paul - thanks for the help. The answer provided by the user on that particular forum question is extremely hard to even decipher what they are saying. I'll keep exploring but not sure I even understand where the author of the post is coming from. – JM4 Dec 01 '10 at 18:43
  • Think all it's saying is that you need to install Xampp's services, and then find them and elevate their privileges to that of your current user rather than the standard local service (no network access). Once they are installed as services you should be able to find them from Control Panel -> Administrative Tools -> Services. Use Task Manager to locate them if you need to. Good luck! – Paul Norman Dec 01 '10 at 20:57
  • @Paul - thanks again but I already had them elevated to the privileges you indicate before. Checked again but still no luck. It *may* be unique to xampp users so i'll check their forums thoroughly. Thanks again. – JM4 Dec 02 '10 at 01:13
0

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

Brian H
  • 833
  • 1
  • 5
  • 12