I have already read lots of other posts about file upload troubles, but I am still unable to resolve this issue.
When I use a form to upload a file, $HTTP_POST_FILES keeps saying that the file is size 0. Now, everything I read says that means that a file was no selected. But, I did select a file.
Here is the code I use:
The form:
<div align="center">
<table border="1" cellspacing="2" cellpadding="2">
<tr>
<td>Date:</td>
<td><input type="text" name="date" size="24" border="0" value="<? $today = date('Y-m-d'); echo $today; ?>"></td>
<td width="15"></td>
<td>System:</td>
<td>
</td>
</tr>
<tr>
<td></td>
<td></td>
<td width="15"></td>
<td></td>
<td></td>
</tr>
<tr>
<td>Title:</td>
<td colspan=5><input type="text" name="title" size="80" border="0"></td>
</tr>
<tr>
<td>Description:</td>
<td colspan=5><textarea name=description rows=5 cols=60></textarea></td>
</tr>
<tr>
<td>File:</td>
<td colspan=5><input type="file" name="testfile" size="60" border="0"></td>
</tr>
</table>
<p><input type="submit" name="add" value="Add Procedure" border="0"><br>
</p>
</div>
</form>
Here is the upload code (very simple):
<?
if($add) {
if($testfile == TRUE){
move_uploaded_file($HTTP_POST_FILES['testfile']['name'], "/projects/sunsupport/htdocs/procedures/pbscm/test.pdf");
}
}
?>