- You can use global variables for eaxample. Form for upload can support as many field as you want, but the upload is executed file by file.
Example for one file (for multiple just repeat the part in which upload is executed):
<?php
global $uploadfile1;
global $uploadfile1_name;
global $upload_dir, $filename1, $MAX_FILE_SIZE;
umask(000);
$upload_dir = "your/upload/dir";
$filename1 = "$upload_dir/$uploadfile1_name";
@copy($uploadfile1, $filename1);
@unlink($uploadfile1);
?>
You'll noticed that you must have a form for upload with fieldnames that are taken for global variables at the start of the code (some global variables are declared after as you can see)
- You can specify multiple dir's for upload, or you can even make dir's while uploading (if path of file is irelevant).
Example:
mkdir("$upload_dir/new/dir");
Set the correct permission.