Re: Web-base Files upload

From: Date: Tue, 14 Nov 2000 00:31:50 +0000
Subject: Re: Web-base Files upload
References: 1 2  Groups: php.db 
Request: Send a blank email to php-db+get-4409@lists.php.net to get a copy of this message
I succeed make a file upload appilcation....Thank you... Finally code : <HTML> <HEAD> <TITLE>PHP Upload by Kenji Chan</TITLE> </HEAD> <BODY> <?PHP if (isset($file)) { if ( $file != "none" ) { echo "File name : $file_name<BR>"; echo "File size : $file_size<BR>"; echo "File path : $file<BR>"; echo "MIME-Type : $file_type<BR>"; echo "Max size : $MAX_FILE_SIZE<BR>"; if ( $file_size < 20000000 ) { if ( copy($file, "".$file_name) ) { echo '<FONT COLOR="#0033CC"><B>Succeed!!</B></FONT><br><HR>'; } else { echo "Error!! The system can't stored the file..<HR>"; } } else { echo "File size error!! ..<HR>"; } } elseif ( !empty($file_name) ) { echo "The file can't biger than $MAX_FILE_SIZE ! ( $file_name )<BR>"; echo "MIME-Type : $file_type<BR>"; } elseif ( empty($file_name) ) { echo "Empty"; } else { echo "Undefined error!<BR>"; echo "MIME-Type : $file_type<BR>"; echo "Max size : $MAX_FILE_SIZE<BR>"; } } ?> <FORM ENCTYPE="multipart/form-data" ACTION="" METHOD="POST" > <INPUT TYPE="hidden" NAME="MAX_FILE_SIZE" VALUE="20000000"> <INPUT TYPE="file" NAME="file"> <INPUT TYPE="submit" VALUE="send"> </FORM> </BODY> </HTML> ********************* ""George A. Fitch III"" <george-fitch@orgella.com> ????? news:E1F0152638DBD311AEF700D0B74455E212D215@EXCHANGE_NH... > > According to 2 books, and the PHP4 manual, this > should work: > > <HTML> > <HEAD> > <TITLE>PHP is Da Bomb!!!</TITLE> > </HEAD> > <BODY> > <?PHP > if (isset($userfile)) { > copy($userfile, "E:\\Public\\$userfile_name"); > } > ?> > <FORM ENCTYPE="mutlipart/form-data" ACTION="<?PHP print > $PHP_SELF?>" > METHOD="POST" > > <INPUT TYPE="hidden" NAME="MAX_FILE_SIZE" > VALUE="1024000"> > <INPUT TYPE="file" NAME="userfile"> > <INPUT TYPE="submit" VALUE="Get File"> > </FORM> > </BODY> > </HTML> > > But it doesn't on my computer. Maybe it'll work > on yours. > > Happy Coding, > > Gaf > > -----Original Message----- > From: kenji chan [mailto:kenjikenji@bigpond.com] > Sent: Monday, November 13, 2000 12:37 PM > To: php-db@lists.php.net > Subject: [PHP-DB] Web-base Files upload > > > Have php had Files upload function? ( Bulid in) > If yes, how do i make the code? > Anyone done it? > Please E-mal here : kylw@lovehk.com or kenjikenji@bigpond.com > > > > -- > PHP Database Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-db-unsubscribe@lists.php.net > For additional commands, e-mail: php-db-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net > > > -- > PHP Database Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-db-unsubscribe@lists.php.net > For additional commands, e-mail: php-db-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net >

« previous php.db (#4409) next »