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
hondek
post
Post #2





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

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


Ciezko powiedziec (IMG:http://forum.php.pl/style_emoticons/default/winksmiley.jpg) skrypt zachowuje sie tak samo jak u mnie, czyli : wybieram fotke, wypisuje mi ją pod buttonem "Browse" i gdy klikam Upload files znika... no ale nie wiem czy pojawia sie na serverze gdzie jest demo uploadify :/

a da sie jakos sprawdzic czy w ogole wykonuje sie plik upload.php ?
albo czy wykonuje sie move_uploaded_file ?

Juz wiem... to jednak wina servera, mianowicie:

echo $_SERVER['DOCUMENT_ROOT'] zwraca /var/www, a strona jest w /home/*/public_html ...

ale to chyba nie jedyny problem bo dziala jezeli upload.php wyglada tak :
  1. <?php
  2. if (!empty($_FILES)) {
  3.  
  4.    $tempFile = $_FILES['fileIn']['tmp_name'];
  5.  
  6.    //$targetPath = '/home/desktop/public_html/' . $_GET['folder'] . '/';
  7.  
  8.    $targetFile =  '/home/desktop/public_html/uploads/' . $_FILES['fileIn']['name'];
  9.  
  10.    
  11.  
  12.    // Uncomment the following line if you want to make the directory if it doesn't exist
  13.  
  14.    //mkdir(str_replace('//','/',$targetPath), 0755, true);
  15.  
  16.    
  17.  
  18.    move_uploaded_file($tempFile,$targetFile);
  19.  
  20. }
  21. ?>


a gdy jest
  1. <?php
  2. if (!empty($_FILES)) {
  3.  
  4.    $tempFile = $_FILES['Filedata']['tmp_name'];
  5.  
  6.    $targetPath = '/home/desktop/public_html/' . $_GET['folder'] . '/';
  7.  
  8.    $targetFile =  str_replace('//','/',$targetPath) . $_FILES['Filedata']['name'];
  9.  
  10.    
  11.  
  12.    // Uncomment the following line if you want to make the directory if it doesn't exist
  13.  
  14.    //mkdir(str_replace('//','/',$targetPath), 0755, true);
  15.  
  16.    
  17.  
  18.    move_uploaded_file($tempFile,$targetFile);
  19.  
  20. }
  21. ?>


to juz pliku nie zapisuje, jakby $_GET['folder'] nie docierala :/

Ten post edytował hondek 13.06.2009, 14:07:06
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: 9.10.2025 - 07:50