Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> Serwer i upload plików, Potrzebuje pomoc bo nie działa mi upload
-Gość_Miki-
post 26.06.2005, 11:11:55
Post #1





Goście







Chce zrobić upload plików na serwer php. kożystam z plików z kursów i cały czas wyskakuja mi jakies błędy. Wersja serwera to Apache 2.0 czy podać wiecej danych questionmark.gif
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi (1 - 1)
vala
post 26.06.2005, 12:00:56
Post #2





Grupa: Zarejestrowani
Postów: 123
Pomógł: 0
Dołączył: 12.01.2005

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


Przykład 18-1. File Upload Form

<form enctype="multipart/form-data" action="_URL_" method="post">
<input type="hidden" name="MAX_FILE_SIZE" value="30000" />
Send this file: <input name="userfile" type="file" />
<input type="submit" value="Send File" />
</form>


  1. <?php
  2. // In php versions earlier than 4.1.0, $HTTP_POST_FILES should be used instead
  3. // of $_FILES.
  4.  
  5. $uploaddir = '/var/www/uploads/';
  6. $uploadfile = $uploaddir . $_FILES['userfile']['name'];
  7.  
  8. print &#092;"<pre>\";
  9. if (move_uploaded_file($_FILES['userfile']['tmp_name'], $uploadfile)) {
  10. print &#092;"File is valid, and was successfully uploaded. \";
  11. print &#092;"Here's some more debugging info:n\";
  12. print_r($_FILES);
  13. } else {
  14. print &#092;"Possible file upload attack! Here's some debugging info:n\";
  15. print_r($_FILES);
  16. }
  17. print &#092;"</pre>\";
  18.  
  19. ?>


manual sie klania


--------------------
Warsztat: Easy PHP 1.7:Apache 1.3.27|PHP 4.3.3|PHPMYADMIn 2.5.3|MYSQL 4.0.15
Go to the top of the page
+Quote Post

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

 



RSS Wersja Lo-Fi Aktualny czas: 14.08.2025 - 05:38