[php] uploaden , filename probleem

Pagina: 1
Acties:

  • HenkS
  • Registratie: Mei 2000
  • Laatst online: 19:32

HenkS

Da_king alias HenkS

Topicstarter
hallo,

met de volgende code in een form doe ik een file selecteren om up te loaden:
<TR><TD>Foto uploaden: (* <i>max 80 kB</i></TD><TD><INPUT NAME="file" TYPE="file"></td></TR>

dan na een submit, doe ik dmv php code de file uploaden, dit gaat ook goed, maar dan moet ik wel zelf een filename verzinnen, maar hoe haal ik dmv php de filename op van de file die geselecteerd is?

  • RdeTuinman
  • Registratie: Mei 2001
  • Laatst online: 16-08 07:25
Zit dat niet in het VALUE gedeelte van FILE
PHP:
1
2
3
<?
$filenaam = $file;
?>

ofzo..

Heb je misschien wel het hele pad, maar dan moet je even strippen..

  • goalgetter
  • Registratie: Juni 1999
  • Laatst online: 25-08 15:24
Je zou natuurlijk op php.net kunnen gaan zoeken en hier uitkomen...
In PHP, the following variables will be defined within the destination script upon a successful upload, assuming that register_globals is turned on in php.ini. If track_vars is turned on, they will also be available in PHP within the global array $HTTP_POST_VARS. Note that the following variable names assume the use of the file upload name 'userfile', as used in the example above:


$userfile - The temporary filename in which the uploaded file was stored on the server machine.

$userfile_name - The original name or path of the file on the sender's system.

$userfile_size - The size of the uploaded file in bytes.

$userfile_type - The mime type of the file if the browser provided this information. An example would be "image/gif".