-1
How do I upload files without including input file
,
that is, only using textField
in HTML?
I managed to solve staff follows below the solution
<?php
$numtotal=5;
$erro;
for($i=0;$i<$numtotal;$i++){
$arquivo=$_POST['arquivo'][$i];
$format=str_replace(".txt","",$arquivo);
$tipoArq=substr($arquivo,-4);
$arquivoinvert=strrev($arquivo);
$arquivoinvert=strstr($arquivoinvert,"/",true);
$arquivoinvert=strrev($arquivoinvert);
if($tipoArq==".txt"){
$arquivoinvert=str_replace(".txt","",$arquivoinvert);
$formatadata=date("d-m-Y-h-i-s");
$formatdata=str_replace("-","",$formatadata);
$caminho="/opt/lampp/htdocs/upload/uploads/".$arquivoinvert.$formatdata.$tipoArq;
copy($arquivo,$caminho);
include ("banco.php");
echo $arquivo.'<br/>';
}
else{
$erro="A extensão do arquivo não é valida";
echo $erro;
}
}
?>
What do you mean? want to save only the path and not the content?
– Sergio
You want to without
input
? Would not beinput
occult? See this example: http://jsfiddle.net/u4W8G/– abfurlan
There is a jQuery Dropzone plugin that can solve your problem: http://www.dropzonejs.com/
– Sileno Brito
I don’t need more @Silenobrito, thank you for the suggestion, I did it in the nail using the textfield ;)
– user3677610
Please publish your solution as an Answer. And check out editing help.
– brasofilo