My apologies because my first post did not meet the standards of the site
I replay my issue
Am trying to upload a folder with more than 200 files with JavaScript & php. The issue is that it’s just upload 21 files and stops after that showing the issue: undefined index 21.
my html file : home.html
<form method="POST" id="upload_folder_form">
<div class="row">
<input class="action" type="hidden" name="action" value="upload">
<input class="parent_id" type="hidden" name="parent_id" value="0">
<div class="form-group">
<label for="nom">Folder</label>
<input id="files[]" type="file" name="files[]" class="form-control" webkitdirectory multiple>
</div>
<div class="form-group">
<div class="col-lg-12">
<button type="submit" class="btn color-cmc pull-right" name="btn_envoi">
<i class="fa fa-upload"></i> Import
</button>
<button type="button" class="btn btn-default pull-right" data-dismiss="modal">Annuler</button>
</div>
</div>
</div>
</form>
my Javascripy file : Folder.js
$('#upload_folder_form').submit(function (e) {
e.preventDefault();
//récuperation des variables
let form = $('#upload_folder_form');
let action = $('.action').val();
let parent_id = $('.parent_id').val();
let redirect = "http://localhost/archivia/app/controllers/FolderController.php";
const files = document.querySelector('[type=file]').files;
let size = files.length;
const formData = new FormData();
formData.append('action', action);
formData.append('parent_id', parent_id);
formData.append('size', size);
for (let i = 0; i < files.length; i++) {
let file = files[i];
let fileParamName = `file${i}`;
let filePathParamName = `filepath${i}`;
formData.append(fileParamName, file);
formData.append(filePathParamName, file.webkitRelativePath);
}
axios.post(redirect, formData).then(function (result) {
console.log(result.data);
});
return false;
});
My Php file : FolderController.php
function upload(){
$path = "../../public/Archives CMC/";
$size = $_POST['size'];
var_dump($_FILES);
for($i = 0; $i < $size; $i++){
$folderpath = $path.dirname($_POST['filepath'.$i]);
$file = $_FILES['file'.$i];
$filename = $file['name'];
$file_tmp = $file["tmp_name"];
if (file_exists($path.$folderpath)){
move_uploaded_file($file_tmp, $path.$folderpath.'/'.$filename);
}else{
mkdir($path.$folderpath,0644,true);
move_uploaded_file($file_tmp, $path.$folderpath.'/'.$filename);
}
}
}
For a folder that gots more than 30 files, juste 20 will be uploaded
How can I come over it please???
Thanks
prednisone price uk – buy prednisone online from mexico prednisone 10 mg tablets
provigil 200 mg – modafinil 100mg modafinil anxiety
buy amoxicillina noscript canada – buy amoxicillina noscript buy amoxicilina 500 mg online
buy vardenafil no prescription uk – vardenafil bayer can you buy vardenafil online
buy stromectol – ivermectin brand name purchase stromectol
how to purchase cialis – offshore pharmacy no prescription 100 mg tadalafil
buy stromectol uk – stromectol 3 mg dosage ivermectin tablets for sale walmart
accutane online canada pharmacy – accutane for sale without prescription accutane for sale uk
lyrica 100 mg capsule – lyrica medication cost canadian international pharmacy association
buy amoxil – amoxicillin for uti amoxil 250
generic brand viagra – generic sildenafil in us viagra Houston
cost of 10 mg tadalafil pills – cialis generic drug cheapest 20 mg cialis
cost 50mg prednisone tablets – prednisone 5 mg tablet rx prednisone capsules
modafinil 100mg – modafinil side effects provigil a controlled substance
azithromycine – zithromax 500mg online zithromax medication
lasix order online uk – furosemide medicine order lasix 40 mg
clomiphene online – order clomiphene generic clomid
where to buy viagra in india – price of sildenafil 100mg generic sildenafil soft tabs
india pharmacy mail order – generic ed drugs generic cialis for daily use
ivermectin 3mg tab – stromectol 6mg stromectol medicine
buy cialis online paypal – Cialis visa discount cialis no prescription
generic stromectol – topical ivermectin cost ivermectin cost in usa
baya iyi bir uygulama olmus bu kadarini beklemiyordum ??
prednisone 50 tablet – prednisone 20mg no prescription brand name drug prednisone
90 mg accutane – buy accutane cheap accutane cost in south africa
medrol generic name – medrol 16mg without prescription buy medrol 4 mg online
order hydroxychloroquine 400mg online – plaquenil 200mg canada valtrex 500mg us
sildalis tablet – order sildalis generic generic glucophage 1000mg
oral ampicillin 250mg – hydroxychloroquine cheap buy generic plaquenil 400mg
buy plaquenil 400mg online – purchase hydroxychloroquine online cheap plaquenil 400mg cheap
sildenafil prix – cialis 5mg en france tadalafil 5mg generique
tadalafil order online no prescription where to get tadalafil
purchase lyrica – zithromax tablet buy generic azithromycin
cialis without prescription tadalafil online
cialis tadalafil generic tadalafil from uk
what is tadalafil cheap cialis pills for sale
best price usa tadalafil side effects of tadalafil
cialis at canadian pharmacy buy cialis pills
ivermectin online generic ivermectin 6 mg purchase stromectol online
stromectol tablets for sale ivermectin pills
ivermectin cost http://www.ivermectinusd.com/
order stromectol over the counter