tags:

views:

70

answers:

2

I am looking for a solution to upload multiple files from browser to server. As of now the HTML pages are written in oracle HTTP toolkit (using oracle mod_plsql on Windows NT).

Can someone suggest me solution to upload files from client side and process it in server. Solutions based on HTML, Oracle HTTP, PHP are fine. Links and suggestions are greatly appreciated.

+1  A: 

You know about http://de.php.net/manual/en/features.file-upload.php ?

Martin Hohenberg
+1  A: 

You could use something like this, but I would suggest adding a lot more validation.

<?php


switch ($_REQUEST['mode']

    case 'upload':

     $ourpath = "/ourfolder/uploads/";

     $target_path = $target_path . basename( $_FILES['uploadedfile']['name']); 

     if(move_uploaded_file($_FILES['uploadedfile']['tmp_name'], $target_path)) {
      echo "You have uploaded".  basename( $_FILES['uploadedfile']['name']);
     } else{
      echo "There was an error uploading the file, please try again!";
     }

     break;

    default: 

    ?><form enctype="multipart/form-data" method="POST">
    <input type="hidden" name="MAX_FILE_SIZE" value="100000" />
    Select a File: <input name="uploadedfile" type="file" /><br />
    <input type="hidden" name="mode" value="upload" />
    <input type="submit" value="Submit" />
    </form>

<?php

}

?>
Jeremy Morgan