Hello,
To use the move_uploaded_file(), basically we need to have the following:
Form:
<input type="hidden" name="MAX_FILE_SIZE" value="5120000" />
<input type="FILE" name="file1" value="{file1}" size="50">
PHP:
$file1_tmp = $FILES['file1']['tmp_name'];
$file1_name = $FILES['file1']['name'];
$file1_size = $FILES['file1']['size'];
$file1_type = $FILES['file1']['type'];
Upload:
if (!move_uploaded_file($file1_tmp,$upload_dir.$file1_name))
However, after I have checked the file, I might need to go to another page to prompt the user to make a choice in case of duplicated file names, etc. The other page will be simple choice of buttons, without the form. If the user decides to continue to upload, if I call if (!move_uploaded_file($file1_tmp,$upload_dir.$file1_name)), the move will fail. My guess is that $file1_tmp is no longer valid due to switching to different pages.
Does anyone have any suggestions how can I continue to do the upload after I have prompted the user on a different page... Thanks.
Jason