|
Posted by Andy Jeffries on 12/18/17 11:48
On Tue, 23 May 2006 13:51:35 +0100, Paul wrote:
> Okay, I've done that, but it's now giving an empty file of 0 bytes in
> length.
>
> The new code looks like this
<snipped>
> As a test, I added an echo line after the for loop and the output was
> expected (the created zip file was actually a text file with the echo
> output inside of it). Changing @readfile to readfile showed that the file
> hadn't actually been created.
How can it be if you manually looked at the zip file and saw it was a text
file with the echo output inside of it? My point is, if the file doesn't
exist afterwards it's a problem in the creation (maybe the zip command
isn't putting it in the right place). If the file exists but it's not
going to the browser then it's either a permissions problem or it's
looking in the wrong place.
That should give you a nudge to do some echos (remove the header lines so
you can just see the output of the echos) to debug which it is.
> Now, if I change where $prog is to be /tmp/$prog, I hit an interesting
> problem, the file is created, but the permissions are for apache:apache
> rather than myself and obviously, chown won't work (unless I sudo it).
> Have I hit more a permissions problem than a php one?
Why would you care if the permissions are for apache:apache? That's who
created the file and who is reading the file (to pass it down to the
browser)?
Cheers,
Andy
--
Andy Jeffries MBCS CITP ZCE | gPHPEdit Lead Developer
http://www.gphpedit.org | PHP editor for Gnome 2
http://www.andyjeffries.co.uk | Personal site and photos
Navigation:
[Reply to this message]
|