<form> <div class="plupload_buttons" id="container"> <div id="queue"></div> <input id="myfile" name="myfile" type="file" multiple="true" class="plupload_button plupload_add" style="position: relative; z-index: 1;"> </div> </form>
{literal}<script> $(document).ready(function() { var settings = { url: "upload.php", method: "POST", allowedTypes:"jpg,png,gif,doc,pdf,zip", fileName: "myfile", multiple: true, onSuccess:function(files,data,xhr) { $("#status").html("<div class='plupload_buttons' id='container'><a href='?id=gal&page=wgraj' class='plupload_button plupload_add' style='position: relative; z-index: 1;'>Wgraj</a>/div>"); }, onError: function(files,status,errMsg) { $("#status").html("<font color='red'>Nieudany przesył </font>"); } } }); </script>{/literal}
potrzebuję przekazać zmienną $this->dir która ma postać : w php $this->dir = GAL.'org/' ; gdzie GAL to zmienna zdefiniowana do galerii i jest tworzona podczas instalacji
plik upoland.php
$dir = $_POST['dir'] ; { $error =$_FILES["myfile"]["error"]; { { $ImageType = $_FILES['myfile']['type']; //"image/png", image/jpeg etc. $NewImageName = $ImageName.'-'.$RandomNum.'.'.$ImageExt; //echo "<br> Error: ".$_FILES["myfile"]["error"]; $ret[$fileName]= $dir.$NewImageName; } else { for($i=0; $i < $fileCount; $i++) { $ImageType = $_FILES['myfile']['type'][$i]; //"image/png", image/jpeg etc. $NewImageName = $ImageName.'-'.$RandomNum.'.'.$ImageExt; $ret[$NewImageName]= $output_dir.$NewImageName; } } } }
Oczekuję jakiś pomysłów lub przeróbek kodu . Może coś jest żle