Page 1 of 1

upload a file

Posted: Wed Mar 26, 2003 1:15 pm
by micknic
I would like to give the opportunity to my websites users to upload files on the server. Is this the good syntax??

<html>
<head>
<title>Chargement de fichier</title>
</head>
<body>
<H3>Cette page vous permet d'envoyer un fichier sur le serveur</H3>
<form action="upload.php" enctype="multipart"/form-data" method="post">
<input type="hidden" name="MAX_FILE_SIZE" value="1024"/>
Charger le fichier: <input name="fichier" type="file" /><br />
<input type="submit" value="GO >>">
</form>
</body>
</html>

do I have to use move_uploaded_file after?? I think this syntax change the name of the file. Is it true??? If yes how to keep the real name of the file?????

Posted: Wed Mar 26, 2003 1:35 pm
by daven
viewtopic.php?t=6435

Code/discussion about file uploading scripts

Your code seems to be decent for the client side. The processing stuff is entirely separate.

Posted: Wed Mar 26, 2003 2:12 pm
by micknic
Hi daven

You gave me many advices today and i would like to thank you. I looked the link you wrote.
If i understand well with the code of the men you helped the name of the uploaded file keep his temporary name?!?!

and what about the downloading of files?

For the end of the day you are going to hate me :wink:

Posted: Wed Mar 26, 2003 2:38 pm
by Coco
so far as i know, the file is saved to a temp dir with its origional name. Obviously you dont want to leave it there, so you should copy it to somewhere else.
If i understand it right $userfile is the name of the file.