Page 1 of 1

File Upload

Posted: Thu Jul 24, 2003 9:28 am
by Zeceer
Hi,

got his form

Code: Select all

<form method="post" action="images_add_script.php" enctype="multipart/form-data">

    <input type="file" name="image" size="25">

    <input type="submit" value="Legg til!">
    
    </form>
and this is the script

Code: Select all

@copy("$image" , "../images/uploaded/")
or die("Could not upload.");
It want upload whatever I do. For some reason :oops:

Posted: Thu Jul 24, 2003 9:36 am
by DuFF
Try looking here for some more help with file uploads:

http://www.php.net/manual/en/features.file-upload.php

You will need to do something like this

Code: Select all

<?php
$uploaddir = path/to/upload/folder;
copy($_FILES["image"]["tmp_name"], $uploaddir .$_FILES["filename"]["name"])
?>