ileriye işlem için komut dosyası başka bir bölümüne yüklenen dosyaları geçen

0 Cevap php

Ben forumu araştırdım ama bu yüzden farklı bir soru sormak istiyorum kontrol akışı hakkında yakın soru yardım etmedi ya da ben anlayamadım.

Ben bir dizine katları dosyaları yükler bir html formu var. Yükleme kolları yükleme yöneticisi ben işlenmesi için dosya adları geçmek için gereken farklı bir kodla aynı komut bulunur.

Sorun dosyaların tarih almak olduğunu ancak diğer kod tarafından işlenmiş olsun istemiyorum. Ben dosyaları geri kalan kodu ile işlenebilir böylece bitişik kod $ _FILES ['uploadedfile'] ['tmp_name']) geçmek için doğru yolu hakkında emin değilim. Komut aşağıda bulabilirsiniz.

More specif explanation: this script does specifically 2 things. the first part handles file uploads and the scecond part starting from the italised comment extracts data from the numerous uploaded files. This part has a variable $_infile which is array which is suppose to get the uploaded files. I need to pass the files into this array. so far i struggled and did this: $inFiles = ($_FILES['uploadedFile']['tmp_name']); which is not working. You can see it also in the full code sample below. there is no error but the files are not passed and they are not processed after uploading.

" ; echo "Number of files submitted $number_of_uploaded_files .
"; echo "Number of successfully moved files $number_of_moved_files .
"; echo "File Names are
" . implode(',', $uploaded_files); */* This is the start of a script to accept the uploaded into another array of it own for* processing.*/ $searchCriteria = array('$GPRMC'); //creating a reference for multiple text files in an array **$inFiles = ($_FILES['uploadedFile']['tmp_name']);** $outFile = fopen("outputRMC.txt", "w"); $outFile2 = fopen("outputGGA.txt", "w"); //processing individual files in the array called $inFiles via foreach loop if (is_array($inFiles)) { foreach($inFiles as $inFileName) { $numLines = 1; //opening the input file $inFiles = fopen($inFileName,"r"); //This line below initially was used to obtain the the output of each textfile processed. //dirname($inFileName).basename($inFileName,'.txt').'_out.txt',"w"); //reading the inFile line by line and outputting the line if searchCriteria is met while(!feof($inFiles)) { $line = fgets($inFiles); $lineTokens = explode(',',$line); if(in_array($lineTokens[0],$searchCriteria)) { if (fwrite($outFile,$line)===FALSE){ echo "Problem w*riting to file\n"; } $numLines++; } // Defining search criteria for $GPGGA $lineTokens = explode(',',$line); $searchCriteria2 = array('$GPGGA'); if(in_array($lineTokens[0],$searchCriteria2)) { if (fwrite($outFile2,$line)===FALSE){ echo "Problem writing to file\n"; } } } } echo "

For the file ".$inFileName." read ".$numLines; //close the in files fclose($_FILES['uploadedFile']['tmp_name']); fflush($outFile); fflush($outFile2); } fclose($outFile); fclose($outFile2); } ?>

0 Cevap