Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [jQuery] uploadify
hondek
post
Post #1





Grupa: Zarejestrowani
Postów: 355
Pomógł: 50
Dołączył: 20.08.2007
Skąd: Częstochowa

Ostrzeżenie: (0%)
-----


Witam!
uploadify nie uploaduje mi plikow, nie wiem dlaczego, oto moja konfiguracja:

w <head>
  1. <script type="text/javascript" src="js/jqueryuploadify/jquery-1.3.2.js"></script>
  2. <script type="text/javascript" src="js/jqueryuploadify/jquery.uploadify.js"></script>


dalej..

  1. <script type="text/javascript">
  2. $(document).ready(function() {
  3. $('#fileIn').fileUpload({
  4. 'uploader':'js/jqueryuploadify/uploader.swf',
  5. 'fileExt':'*.jpg;*.jpeg;*.JPG',
  6. 'script':'js/jqueryuploadify/upload.php',
  7. 'cancelImg':'js/jqueryuploadify/cancel.png',
  8. 'folder':'uploads',
  9. onError: function (a, b, c, d) {
  10. if (d.status == 404)
  11. alert('Could not find upload script. Use a path relative to: '+'<?= getcwd() ?>');
  12. else if (d.type === "HTTP")
  13. alert('error '+d.type+": "+d.status);
  14. else if (d.type ==="File Size")
  15. alert(c.name+' '+d.type+' Limit: '+Math.round(d.sizeLimit/1024)+'KB');
  16. else
  17. alert('error '+d.type+": "+d.text);
  18. }
  19. });
  20. });
  21.  
  22. <input type="file" name="fileIn" id="fileIn" />
  23. <a href="javascript:$('#fileIn').fileUploadStart();">Upload Files</a>


I klikam Browse, dodaje fotke, laduje ja, klikam Upload Files, przez sekunde widac napis "Complete", ale nic sie nie pojawia w katalogu uploads :/ wie ktos gdzie robie blad?

UPDATE:
dodam jeszcze tylko, ze katalog uploads ma prawa zapisu (777)

Ten post edytował hondek 13.06.2009, 12:22:15
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi
bliitz
post
Post #2





Grupa: Zarejestrowani
Postów: 155
Pomógł: 12
Dołączył: 5.04.2008

Ostrzeżenie: (0%)
-----


Odświeżam temat bo też mam problem z uploadify. U mnie akurat pliki uploaduje jak na razie w porządku natomiast mam problem z podejrzeniem co jest przekazywane w $_FILES i $_POST.

Plik z dodawaniem pliku wygląda tak:
  1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
  2. <head>
  3. <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  4. <link href="default.css" rel="stylesheet" type="text/css" />
  5. <link href="uploadify.css" rel="stylesheet" type="text/css" />
  6. <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.0/jquery.min.js"></script>
  7. <script type="text/javascript" src="swfobject.js"></script>
  8. <script type="text/javascript" src="jquery.uploadify.v2.1.0.min.js"></script>
  9. </head>
  10. <body>
  11. <input type="file" name="up" id="up" />
  12. <a href="java script:$('#up').uploadifyUpload();">Upload Files</a>
  13.  
  14. <script type="text/javascript">
  15. $(document).ready( function() {
  16. $('#up').uploadify({
  17. 'uploader': 'uploadify.swf',
  18. 'script': 'uploadify.php',
  19. 'folder': 'uploadify',
  20. 'cancelImg': 'cancel.png',
  21. 'method': 'POST',
  22. 'buttonText': 'Wybierz plik'
  23. });
  24. });
  25. </script>
  26. </body>
  27. </html>


i uploadify.php

  1. if (!empty($_FILES)) {
  2. $tempFile = $_FILES['Filedata']['tmp_name'];
  3. $targetPath = '/var/www/kohana/media/galleries/107/';
  4. $targetFile = str_replace('//','/',$targetPath) . $_FILES['Filedata']['name'];
  5. print_r( $_POST );
  6. print_r( $_FILES );
  7. // $fileTypes = str_replace('*.','',$_REQUEST['fileext']);
  8. // $fileTypes = str_replace(';','|',$fileTypes);
  9. // $typesArray = split('\|',$fileTypes);
  10. // $fileParts = pathinfo($_FILES['Filedata']['name']);
  11.  
  12. // if (in_array($fileParts['extension'],$typesArray)) {
  13. // Uncomment the following line if you want to make the directory if it doesn't exist
  14. // mkdir(str_replace('//','/',$targetPath), 0755, true);
  15.  
  16. //move_uploaded_file($tempFile,$targetFile);
  17. //echo "1";
  18.  
  19. // } else {
  20. // echo 'Invalid file type.';
  21. // }
  22. }


Problem w tym, że mimo użycia print_r nic się nie wyświetla nawet napis Array().

W jaki sposób można podejrzeć te dane?
Go to the top of the page
+Quote Post

Posty w temacie


Reply to this topicStart new topic
2 Użytkowników czyta ten temat (2 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 14.10.2025 - 23:24