PEAR Forum :: PHP Extension and Application Repository

PEAR Forum Forum Index
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
Upload and Archive file with Archive_tar

 
Post new topic   Reply to topic    PEAR Forum Forum Index -> File Formats
View previous topic :: View next topic  
Author Message
lyubo1



Joined: 03 Nov 2008
Posts: 1

PostPosted: Mon Nov 03, 2008 4:35 pm    Post subject: Upload and Archive file with Archive_tar Reply with quote

Hallo!

I load file of a form

Code:
<form enctype="multipart/form-data" action="" method="POST">
Choose a file to upload: <input name="upload" type="file" /><br />
<input type="submit" value="Upload File" />
</form>


and PHP code

Code:

                        $name = $_FILES['upload']['name'];
         $file = $_FILES['upload']['tmp_name'];
         
         $filename = "$name" . '.tar.gz';
         
         require_once ('Archive/Tar.php');
         require_once 'PEAR.php';
         $tar = new Archive_Tar("uploads/$filename", true);
         
         $tar->setErrorHandling(PEAR_ERROR_PRINT);

         $tar->create("$file") or die("Could not create archive!");


I did adjustment ini_set: upload_max_filesize = 100M
When I load big file, the empty archive is made.



Does somebody have got an ideaБ
Back to top
View user's profile Send private message
mark



Joined: 07 Jan 2007
Posts: 1053

PostPosted: Mon Nov 03, 2008 6:07 pm    Post subject: Reply with quote

The 'post_max_size' (IIRC) and 'memory_limit' settings could also be the problem.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    PEAR Forum Forum Index -> File Formats All times are GMT + 2 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum



PEAR Forum topic RSS feed 
Powered by phpBB © 2001, 2005 phpBB Group

Provided by Ministry of Web developement

'Actiemonitor' online projectmanagement software