I have a form to upload files, I have input
of type file
:
<input type="file" class="fileinput" name="pdf"/>
Then, if a file has been selected, I want to create a " PDF's " folder. If the folder already exists I do not create, but if it does not exist, I create it dynamically and later I upload:
if(!empty($_FILES['pdf']['tmp_name'])){
$pasta = '../pdfs/';
$ano = date('Y');
$mes = date('m');
if(!file_exists($pasta.$ano)){
mkdir($pasta.$ano,0755);
}
But I'm having an error with this code:
Warning: mkdir (): No such file or directory in mkdir ($ folder. $ year, 0755);
Why might this error be happening?