Posted by Johnny on 09/25/06 20:15
"Glenn Coyle" <glenn.newsgroup@virgin.net> wrote in message
news:8mWRg.117$t4.2@newsfe3-win.ntli.net...
> Hi
>
> I am having issues with trying to upload files to a directory on my
> server. the first script is the form the second is the upload file, it
> just doesnt identify the file path where it is being uploaded from.
>
> Any ideas?
>
> <form action="getFiles.php" method="get"><br>
> Type (or select) Filename: <input type="file" name="uploadFile">
> <input type="hidden" name="MAX_FILE_SIZE" value="25000" />
> <input type="submit" value="Upload File">
> </form>
>
>
> getfiles.php
> <?
> $target_path = "../slices/";
> $target_path = $target_path . basename( $_FILES['uploadFile']['name']);
> echo $_FILES['uploadFile'];
> if(move_uploaded_file($_FILES['uploadFile']['tmp_name'], $target_path)) {
> echo "The file ". basename( $_FILES['uploadFile']['name']).
> " has been uploaded";
> } else{
> echo "There was an error uploading the file, please try again!";
> }
> ?>
>
>
> I just cant see what is wrong. Please help.
>
> Thanks
>
> Glenn
a case of the missing cipher...or three ;-)
looks odd around these two lines:
> $target_path = "../slices/";
> $target_path = $target_path . basename( $_FILES['uploadFile']['name']);
first you set it to "../slices/";
then you overwrite that with the basename...
maybe you want '.=' rather than just '='
Navigation:
[Reply to this message]
|