My File field is named FILENAME, and I copy it into ./download directory
(from the uploadtemp dir defined in php.ini)

In php.ini, I have parametered 2 lines :

file_uploads = On    ; Whether to allow HTTP file uploads
upload_max_filesize = 2M      ; Maximum allowed size for uploaded files

My form look like :

<FORM NAME="UPLD" onSubmit="Javascript:document.UPLD.BTIMPORT.disabled=true"
ENCTYPE="multipart/form-data" METHOD="POST" ACTION="Importe_groupes.php">
    <TABLE BORDER="0" WIDTH="100%">
      <TR>
        <TD WIDTH="40%" ALIGN="right">List description :</TD>
        <TD WIDTH="60%" COLSPAN="2"><INPUT TYPE="text" NAME="LIBELLEGROUPE"
SIZE="20" MAXLENGTH="40"></TD>
      </TR>
      <TR>
        <TD WIDTH="40%" ALIGN="right">File to import :</TD>
        <TD WIDTH="60%" COLSPAN="2"><INPUT TYPE="file" NAME="FILENAME"
SIZE="20" MAXLENGTH="64"></TD>
      </TR>
      <TR>
        <TD WIDTH="40%" ALIGN="right"></TD>
        <TD WIDTH="60%" COLSPAN="2"></TD>
      </TR>
      <TR>
        <TD WIDTH="40%">
   <P ALIGN="right"><INPUT TYPE="submit" VALUE="Import" NAME="BTIMPORT">
</TD>
<CENTER>
  <TD WIDTH="4%"></TD>
  <TD WIDTH="56%"><INPUT TYPE="reset" VALUE="Cancel" NAME="BTCANCEL"></TD>
</TR>
    </TABLE>
 <INPUT TYPE="hidden" name="MAX_FILE_SIZE" value="2000000">
 <INPUT TYPE="hidden" NAME="TYPEGROUPE" VALUE="2">
</FORM>

The MAX_FILE_SIZE hidden field seems to be mandatory for the upload to work.

The script in Importe_groupes.php begins with :

if(isset($FILENAME_name) && (!empty($FILENAME_name))) {
 $nname = "./download/" . "$FILENAME_name";
 if (file_exists($nname)) exec("del \"$nname\""); // WINNT server...
 if (!copy($FILENAME, $nname)) {
  $page = '<HTML><body text="#003399">';
  $page .= '<META HTTP-EQUIV="REFRESH" CONTENT="4;
URL=Importe_groupes.php">';
  $page .= '<CENTER><H2><BR>Unable to generate file onto the server.<br>';
  $page .='</H2></CENTER></BODY></HTML>';
  echo $page;
  exit();
 }

and here I use the uploaded file...

HTH

--
FX Liagre

[EMAIL PROTECTED]
[EMAIL PROTECTED]

""Warwick Chapman (Budgee)"" <[EMAIL PROTECTED]> a écrit dans
le message news: [EMAIL PROTECTED]
> Howdy
>
> I am trying to get a picture gallery going on a family site. I want
> family members to be able to upload scans, and the gallery code
> to display them. I have the gallery code working fine, but I cannot
> get uploads to work at all.
>
> IIS 5 + Windows 2000 Professional + PHP 4.05 (I have also tried
> Debian Linux 2.2, Apache 1.3.19 and PHP 4.03pl1).
>
> I lose track after the form is submitted. I can't seem to find the
> uploaded file anywhere. It seems not to have been uploaded at all.
>
> Please could someone send me code and system configuratyion
> details which has worked for them.
>
> Thanks and regards
>
> Warwick Chapman (Glenwood 1999)
> http://www.boatrace.co.za
> Assistant IT Manager
> Glenwood High School, Durban, South Africa
> 031 2055241
> 083 7797094
> http://www.glenwoodhighschool.co.za
>
> --
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>



-- 
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to