Hi Everyone
I've now solved the problem.
Many thanks
Tim.
--
My real e-mail address is tim218 before the at followed by supermail.org.uk.
"Tim218" <see.signature@for.email.address.invalid> wrote in message
news:bj7epf$4eh$1@hercules.btinternet.com...[color=blue]
> Sorry the form action should be uploadtest.php not uploadtest.asp (still
> getting the bad M$ habits out of my head!!).
>
> Tim.
>
> --
> My real e-mail address is tim218 before the at followed by[/color]
supermail.org.uk.[color=blue]
>
> "Tim218" <see.signature@for.email.address.invalid> wrote in message
> news:bj7eio$424$1@hercules.btinternet.com...[color=green]
> > Hi Everyone
> >
> > This is my first day with PHP and, not surprisingly, I've run into a[/color]
> problem[color=green]
> > :-)
> >
> > I want to allow file uploads to the server without exposing the
> > non-technical end-users to FTP settings, file naming protocols, etc.[/color][/color]
I've[color=blue][color=green]
> > found the following from[/color]
>
http://www.zend.com/manual/features.file-upload.php[color=green]
> > ...
> >
> > HTML FILE (uploadtest.html)
> >
> > <form enctype="multipart/form-data" action="uploadtest.asp"[/color][/color]
method="POST">[color=blue][color=green]
> > Send this file: <input name="userfile" type="file">
> > <input type="submit" value="Send File">
> > </form>
> >
> > PHP FILE (uploadtest.php)
> >
> > <?php
> > // In PHP earlier then 4.1.0, $HTTP_POST_FILES should be used instead of
> > // $_FILES. In PHP earlier then 4.0.3, use copy() and[/color][/color]
is_uploaded_file()[color=blue][color=green]
> > // instead of move_uploaded_file
> >
> > $uploaddir = '/var/www/uploads/';
> > $uploadfile = $uploaddir. $_FILES['userfile']['name'];
> >
> > print "<pre>";
> > if (move_uploaded_file($_FILES['userfile']['tmp_name'], $uploadfile)) {
> > print "File is valid, and was successfully uploaded. ";
> > print "Here's some more debugging info:\n";
> > print_r($_FILES);
> > } else {
> > print "Possible file upload attack! Here's some debugging info:\n";
> > print_r($_FILES);
> > }
> > print "</pre>";
> > ?>
> >
> > END OF CODE
> >
> > I select a file to upload and the delay in submitting the form suggests[/color]
> that[color=green]
> > the file has been sent. But I always get the "possible file upload[/color]
> attack"[color=green]
> > result. The file info shows the correct filename and type but the[/color]
> filesize[color=green]
> > is always '0' and the 'tmp_name' is always 'none'.
> >
> > Assuming this was the problem I did some digging using phpinfo(). The
> > version is 4.1.2 so I seem to be using the right commands as per the
> > instructions with the code. But the 'upload_tmp_dir' variable is NOT[/color][/color]
SET[color=blue][color=green]
> > which I think might be the problem.
> >
> > So, with apologies for taking so long to get here, I have two queries...
> >
> > 1) Is there anything wrong with the code I'm using?
> > 2) Where do uploaded files go if 'upload_tmp_dir' is not set and how can[/color][/color]
I[color=blue][color=green]
> > bypass this without access to the server (shared hosting)?
> >
> > Any help would be appreciated.
> >
> > Many thanks
> >
> > Tim.
> >
> > --
> > My real e-mail address is tim218 before the at followed by[/color]
> supermail.org.uk.[color=green]
> >
> >[/color]
>
>[/color]