Re: input type=file
| From: | Sebastian Delmont | Date: | Tue, 06 May 2003 22:55:13 +0000 |
| Subject: | Re: input type=file | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-146591@lists.php.net to get a copy of this message | ||
Make sure you are using the "temporary" filename, and not the "original" one.
$_FILES['test']['name'] will be something like "MyFile.doc"
while $_FILES['test']['tmp_name'] will be "/temp/4534gefdg345.tmp"
The second one is the one you want to use on the server.
Try something like
$pdf = $_FILES['pdffile']['tmp_name'];
$pdf_filename = $_FILES['pdffile']['name'];
move_uploaded_file($pdf, "$absbath/$pdf_filename");
Andrew Durk wrote:
I am trying to get the browser to upload a file to the server. When i try to access the variable that "holds" the file, i only get the filename. How do I get the actual file? I tried copy($pdf,"$absbath/$pdf_filename") but that resulted in a: "Warning: Unable to open 'E:\telalink.pdf' for reading: No such file or directory in..." The file is indeed there. What am I doing wrong? Is the copy command looking for a server-side file path? If so, how do I get access to a file on the client browser?? Any help would be wonderful! Tnx in advance.