View previous topic :: View next topic |
Author |
Message |
WeaponsX -
Joined: 14 Sep 2003 Posts: 72 Location: To druck to know.
|
Posted: Tue Feb 17, 2004 3:03 am Post subject: little help with upload |
|
|
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 |
|
|
TRUSTAbyss -
Joined: 29 Oct 2003 Posts: 3752 Location: USA, GA
|
Posted: Tue Feb 17, 2004 5:24 am Post subject: |
|
|
Is that even possible :? |
|
Back to top |
|
|
WhiteDevil -
Joined: 07 Oct 2002 Posts: 74 Location: United Kingdom
|
Posted: Tue Feb 17, 2004 11:00 am Post subject: |
|
|
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 |
|
|
WeaponsX -
Joined: 14 Sep 2003 Posts: 72 Location: To druck to know.
|
Posted: Wed Feb 18, 2004 5:08 am Post subject: |
|
|
So theres no way of doing it? _________________ Picture of my a$$ coming soon till than look at this ( ( ) <== NICE A$$! |
|
Back to top |
|
|
aprelium -
Joined: 22 Mar 2002 Posts: 6800
|
Posted: Wed Feb 18, 2004 3:31 pm Post subject: |
|
|
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 |
|
|
WeaponsX -
Joined: 14 Sep 2003 Posts: 72 Location: To druck to know.
|
Posted: Wed Feb 18, 2004 5:46 pm Post subject: |
|
|
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 |
|
|
aprelium -
Joined: 22 Mar 2002 Posts: 6800
|
Posted: Fri Feb 20, 2004 4:13 pm Post subject: |
|
|
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 |
|
|
|