need help in uploading array of files
Posted: Mon Sep 29, 2003 2:26 am
hi there.....
I need help in uploading an array of files
there is some problem in the code that i am using can any one help me to over come the problem
regards
Abdul Mannan
[mod_edit:
I need help in uploading an array of files
there is some problem in the code that i am using can any one help me to over come the problem
regards
Abdul Mannan
Code: Select all
if ($HTTP_POST_VARS['submit'])
{
if (!is_uploaded_file($HTTP_POST_FILES['file'][temp]))
{
$error = "You did not upload a file!";
unlink($HTTP_POST_FILES['file'][temp]);
// assign error message, remove uploaded file, redisplay form.
}
else
{
//A file was uploaded
$maxfilesize=30000;
if ($HTTP_POST_FILES['file']['size'] > $maxfilesize)
{
$error = "File is too large.";
unlink($HTTP_POST_FILES['file'][temp]);
// assign error message, remove uploaded file, redisplay form.
}
else
{
//File has passed all validation, copy it to the final destination and remove the temporary file:
copy($HTTP_POST_FILES['file'][temp],$HTTP_POST_FILES['file'][use]);
move_uploaded_file(['file'][use], "/place/file.new");
{
unlink($HTTP_POST_FILES['file']);
print "File has been successfully uploaded!";
exit();
}
}
}Code: Select all
tags added][/size]