Oops... Hope this helps others, here is what I did:
// This is your form...
<form name="img1" method="post" action="done.php" target="box"
        <input type="file" name="img1" size="25">
        <input type="submit" name="Submit" value="save">
        <input type="reset" name="reset" value="reset">
// this is the script to upload the file
// Note:  if you want to only upload certain file types... change the
eregi('.jpg$ sting to whatever your file extension should be
// Also the directory in question needs permissions set to 755 for it to
if ($img1_name != "" && eregi('.jpg$', $img1_name)) {
@copy("$img1", "/path/to/directory/$img1_name") or die ("Could not upload
file, please try again after making sure the file is less than 2mb in size
and the file name correct");
 } else {
   die("No file selected for upload, or the file was not the correct type.
Please only upload .jpg files.");

"Michael Andersson" <[EMAIL PROTECTED]> wrote in message
> Maybe you want to share with the rest of us, or at least me how you did
> :)
> /Micke
> "Jas" <[EMAIL PROTECTED]> skrev i meddelandet
> > Nevermind... =)
> > "Jas" <[EMAIL PROTECTED]> wrote in message
> > > I am wondering if any one has a good idea on how to do checking based
> a
> > > files extension, what I am trying to accomplish is to be able to
> > > files to a webserver however I only want to have .jpg files uploaded.
> If
> > > anyone has a good way to do this please share.
> > > Thanks in advance,
> > > Jas
> > >
> > >
> >
> >

PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to