Connecting Tech Pros Worldwide Help | Site Map

zip uploaded files

Andrea Stein
Guest
 
Posts: n/a
#1: Jul 16 '05
hi,
i've a problem to zip files which are uploaded to the server.
(include the class zip.lib.php from phpMyAdmin)

require("inc/zip.lib.php");
$zipfile = new zipfile();
//add the uploaded file to the server (i know that this is not the
temp
//name of the file, so in this case, i would have a zipped and a
unzipped
//file on the server)
$zipfile->addFile("$upload_path/$uploaded_file", "myZip.zip");
$filezipped = $zipfile->file();

//now copy the zipped file to the right directory
copy($filezipped,"$current_dir/$uploaded_file.zip");


i always get a "copy(./PK) [function.copy]: failed to create
stream: No such file or directory in /srv/.../zip.php on line 695"
error." - but the file should be zipped an there, becauce if i made a
"echo $filezipped", i get a result!
can anybody help me?
R. Rajesh Jeba Anbiah
Guest
 
Posts: n/a
#2: Jul 16 '05

re: zip uploaded files


tryagain@gmx.ch (Andrea Stein) wrote in message news:<cca1819c.0307070247.2351f51a@posting.google. com>...[color=blue]
> //now copy the zipped file to the right directory
> copy($filezipped,"$current_dir/$uploaded_file.zip");[/color]

You may use move_uploaded_file(). The path to the file should be
"/home/public_html/myfolder/file.zip" & there should be proper rights
to that folder

---
"I have a dream that one day girls will be measured by the size of
their brains than the shape of their flush"
Email: rrjanbiah-at-Y!com
Closed Thread