The $_FILES array doesn't contain any information (type, name, tmp_name) on the file that is being uploaded. Im trying to pass $_FILES['adVideo'] as a class method parameter but the superglobal doesn't contain any information on the file upload.
Here's the HTML:
<form name="editAdForm" id="editAdForm" method="post" action="/ads/edit/">
<label for="adVideo">Upload Video (.flv only):</label>
<input type="file" name="adVideo" id="adVideo" size="30" />
<br /><br />
</form>
And the PHP:
// Create the method
$editAd = $classPosting->editAd($topicID, $_SESSION['user_id'], true, $_POST, $_FILES['adVideo']);
And so the array is empty even before i pass it to the class method because when i do:
echo $_FILES['adVideo']['tmp_name'];
// Create the method
$editAd = $classPosting->editAd($topicID, $_SESSION['user_id'], true, $_POST, $_FILES['adVideo']);
OR
echo $_FILES['adVideo']['name'];
// Create the method
$editAd = $classPosting->editAd($topicID, $_SESSION['user_id'], true, $_POST, $_FILES['adVideo']);
OR
echo var_dump($_FILES);
// Create the method
$editAd = $classPosting->editAd($topicID, $_SESSION['user_id'], true, $_POST, $_FILES['adVideo']);
They print nothing to the screen, but the var_dump prints: array(0) { }
Thank you rusticle23.
The problem was i forgot to add enctype="mulipart/form-data"
I'd make you the best answer but i don't know how
. I rated though.
Here's the HTML:
<form name="editAdForm" id="editAdForm" method="post" action="/ads/edit/">
<label for="adVideo">Upload Video (.flv only):</label>
<input type="file" name="adVideo" id="adVideo" size="30" />
<br /><br />
</form>
And the PHP:
// Create the method
$editAd = $classPosting->editAd($topicID, $_SESSION['user_id'], true, $_POST, $_FILES['adVideo']);
And so the array is empty even before i pass it to the class method because when i do:
echo $_FILES['adVideo']['tmp_name'];
// Create the method
$editAd = $classPosting->editAd($topicID, $_SESSION['user_id'], true, $_POST, $_FILES['adVideo']);
OR
echo $_FILES['adVideo']['name'];
// Create the method
$editAd = $classPosting->editAd($topicID, $_SESSION['user_id'], true, $_POST, $_FILES['adVideo']);
OR
echo var_dump($_FILES);
// Create the method
$editAd = $classPosting->editAd($topicID, $_SESSION['user_id'], true, $_POST, $_FILES['adVideo']);
They print nothing to the screen, but the var_dump prints: array(0) { }
Thank you rusticle23.
The problem was i forgot to add enctype="mulipart/form-data"
I'd make you the best answer but i don't know how