little help with upload

 
Post new topic   Reply to topic    Aprelium Forum Index -> PHP
View previous topic :: View next topic  
Author Message
WeaponsX
-


Joined: 14 Sep 2003
Posts: 72
Location: To druck to know.

PostPosted: Tue Feb 17, 2004 3:03 am    Post subject: little help with upload Reply with quote

I got this upload script off this site I think Aprelium wrote it..

Code:

<b>Upload a file</b>
<p>
<?php
       
      /*
         Change the value of $upload_dir to refer to the
         directory where uploaded files will to be stored.
      */
      $upload_dir="upload_folder";
       
      if (isset($_REQUEST['submit']))
      {
         if    (   ($_FILES['userfile']['error']==UPLOAD_ERR_OK)
            &&   move_uploaded_file($_FILES['userfile']['tmp_name'],
                           $upload_dir . "/" . $_FILES['userfile']['name'])
            )
               echo $_FILES['userfile']['name'], " Uploaded</a> <BR>";
            else
               echo "The upload failed<BR>";
      };
       
      ?>
<FORM enctype="multipart/form-data" action="<?php echo $_SERVER['PHP_SELF']; ?>" method="POST">
         Upload this file: <INPUT name="userfile" type="file">
         <INPUT type="submit" name="submit" value="Send File">
      </FORM>


What I need it to do is that when someone sends me a file it puts it in a zip folder. Not a normal folder but a zip one. :twisted: thanks
_________________
Picture of my a$$ coming soon till than look at this ( ( ) <== NICE A$$!
Back to top View user's profile Send private message Send e-mail AIM Address
TRUSTAbyss
-


Joined: 29 Oct 2003
Posts: 3752
Location: USA, GA

PostPosted: Tue Feb 17, 2004 5:24 am    Post subject: Reply with quote

Is that even possible :?
Back to top View user's profile Send private message Visit poster's website
WhiteDevil
-


Joined: 07 Oct 2002
Posts: 74
Location: United Kingdom

PostPosted: Tue Feb 17, 2004 11:00 am    Post subject: Reply with quote

I think somebody released a lib that allows you to zip files with PHP, it means recompiling it though - id find another way round if i were you :)
_________________
Back to top View user's profile Send private message Send e-mail Visit poster's website AIM Address MSN Messenger
WeaponsX
-


Joined: 14 Sep 2003
Posts: 72
Location: To druck to know.

PostPosted: Wed Feb 18, 2004 5:08 am    Post subject: Reply with quote

So theres no way of doing it?
_________________
Picture of my a$$ coming soon till than look at this ( ( ) <== NICE A$$!
Back to top View user's profile Send private message Send e-mail AIM Address
aprelium
-


Joined: 22 Mar 2002
Posts: 6800

PostPosted: Wed Feb 18, 2004 3:31 pm    Post subject: Reply with quote

WeaponsX wrote:
So theres no way of doing it?

PHP had limited Zip support. Its Zip module can only read Zip files. It cannot create them. But it supports .gz files (using the ZLib module). gz files are widely supported on Windows and UNIX and have a better compression ratio than Zip.

If you don't want to use GZ files, you can tell PHP to execute a DOS command to compress a file using shell_exec (of course, you must have pkzip or a similar DOS utility to achieve this compression).
_________________
Support Team
Aprelium - http://www.aprelium.com
Back to top View user's profile Send private message Send e-mail
WeaponsX
-


Joined: 14 Sep 2003
Posts: 72
Location: To druck to know.

PostPosted: Wed Feb 18, 2004 5:46 pm    Post subject: Reply with quote

I don't want php to create a zip folder I just want it to act as a normal folder. So when someone uploads a file to my server its in the zip folder and not a normal one. Whats a .gz file and how do I make them in windows? If php works better with .gz files how do you make it upload a file sent to my computer to a .gz file?
_________________
Picture of my a$$ coming soon till than look at this ( ( ) <== NICE A$$!
Back to top View user's profile Send private message Send e-mail AIM Address
aprelium
-


Joined: 22 Mar 2002
Posts: 6800

PostPosted: Fri Feb 20, 2004 4:13 pm    Post subject: Reply with quote

WeaponsX wrote:
I don't want php to create a zip folder I just want it to act as a normal folder.

According to what we know, that depends on Windows and it isn't very easy to do.
.GZ files are compressed files. They are similar to Zip but can only contain a single compressed file.
The best is to have a look on the PHP manual to get some ideas.
_________________
Support Team
Aprelium - http://www.aprelium.com
Back to top View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic    Aprelium Forum Index -> PHP All times are GMT + 1 Hour
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


Powered by phpBB phpBB Group