TAR
TAR

Reputation: 1

send file in http (Upload from client store in server)

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.

Upvotes: 0

Views: 1004

Answers (2)

Jeremy Morgan
Jeremy Morgan

Reputation: 3372

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

}

?>

Upvotes: 1

ty812
ty812

Reputation: 3323

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

Upvotes: 1

Related Questions