PHP Upload Script Not Functioning -
the following code appears upload zips, not in fact create document according naming convention i'm using:
// upload zip
if((isset($_files['arquivo']['name'][0])) && ($_files['arquivo']['type'] == 'application/zip, application/octet-stream') && ($_files['arquivo']['size'] < 1000000)){ $arq = 'documento_'.uniqid().".zip'; $path = '/home/domain_name_here/www/documentos/'; $documento = $path.$arq; move_uploaded_file($_files['arquivo']['tmp_name'], $documento); chmod($documento, 0777); }
not entirely sure why isn't functioning way should. seems files upload temporary , fail somewhere between there , documentos folder.
thanks in advance!
i suspect line contains error:
$arq = 'documento_'.uniqid().".zip';
you have double quote instead single quote wrapping .zip
. should be:
$arq = 'documento_'.uniqid().'.zip';
Comments
Post a Comment