ziedinjsh Posted September 25, 2009 Report Share Posted September 25, 2009 Sveiki.. Lejupielādēju failu uploaderi no www.uploadify.com/ Tur bija js, swf, php un css faili.. ieliku viņus misc mape un pēc tam index.php ieliku šādu kodu: <input id='fileInput' name='fileInput' type='file' /> <script type='text/javascript'> $(document).ready(function() { $('#fileInput').uploadify({ 'uploader' : 'misc/uploadify.swf', 'script' : 'misc/uploadify.php', 'cancelImg' : 'misc/cancel.png', 'auto' : true, 'folder' : '/mp3' }); }); upload poga parādās.. izvēlos failu.. parāda ka 100% uzlādēts.. complete. Bet fails folderā nav! tur vēl bija šādi php: postify.php: <?php if (!empty($_FILES)) { $tempFile = $_FILES['Filedata']['tmp_name']; $targetPath = $_SERVER['DOCUMENT_ROOT'] . $_REQUEST['folder'] . '/'; $targetFile = str_replace('//','/',$targetPath) . $_FILES['Filedata']['name']; // $fileTypes = str_replace('*.mp3','',$_REQUEST['fileext']); // $fileTypes = str_replace(';','|',$fileTypes); // $typesArray = split('\|',$fileTypes); // $fileParts = pathinfo($_FILES['Filedata']['name']); // if (in_array($fileParts['extension'],$typesArray)) { // Uncomment the following line if you want to make the directory if it doesn't exist // mkdir(str_replace('//','/',$targetPath), 0755, true); move_uploaded_file($tempFile,$targetFile); echo "1"; // } else { // echo 'Invalid file type.'; // } } ?> un check.php <?php $fileArray = array(); foreach ($_POST as $key => $value) { if ($key != 'folder') { if (file_exists($_SERVER['DOCUMENT_ROOT'] . $_POST['folder'] . '/' . $value)) { $fileArray[$key] = $value; } } } echo json_encode($fileArray); ?> skatījos js failos, tur nekur nebija jānorāda failu folderis.. kas varētu būt pa problēmu? Quote Link to comment Share on other sites More sharing options...
anonīms Posted September 25, 2009 Report Share Posted September 25, 2009 postify.php ir jānorāda folderis (precīzāk tur ir norādīta kur tas viss nonāk) Quote Link to comment Share on other sites More sharing options...
ziedinjsh Posted September 25, 2009 Author Report Share Posted September 25, 2009 (edited) tad man jānorādā šadi kaut kā: $targetPath = $_SERVER['DOCUMENT_ROOT'] . $_REQUEST['folder'] . 'http://domens.lv/mp3/'; kaut kā tā? es tā paprovēju.. vienalga neparādās fails.. postify.php atrodas misc folderā un mp3 folders man atrodas vienu folderi uz atpakaļu.. tad es pameiģināju šādi: $targetPath = $_SERVER['DOCUMENT_ROOT'] . $_REQUEST['folder'] '../mp3'; vienalga neiet Edited September 25, 2009 by ziedinjsh Quote Link to comment Share on other sites More sharing options...
tas_pats Posted September 26, 2009 Report Share Posted September 26, 2009 tak ar echo izvadi ārā $target_path un apskaties kādas muļķības tev tur ir saliktas. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.