My problem is that when i process the data from the form the $FILES array remains empty (var_dump says array(0)). The $HTTP_POST_FILES array doesn't work either. On the other hand $POST passes the name of the uploaded file. The form looks as follows:
<form action="/PW/dydaktyka/index.php?dokument_id=admin" method="post"> <input type="hidden" name="polecenie" value="dodaj_wiadomosc_przetwarzaj" /> <input type="hidden" name="adresat" value="-1" /> Tytu³: <input type="text" name="tytul" size="80" /><br> Tre¶æ:<br> <textarea name="tresc" rows="20" cols="80"> </textarea><br> Obrazek dot. wiadomo¶ci (format jpg, nie wiêkszy ni¿ 500kB, najwiêkszy wymiar bêdzie zmniejszony do 600 pikseli):<br> <input type="hidden" name="MAX_FILE_SIZE" value="500000"> <input name="obrazek" type="file"><br /> <button type="reset" name="reset"> Skasuj </button> <input type="submit" value="Dodaj wiadomo¶æ."> </form>
<form action="/PW/dydaktyka/index.php?dokument_id=admin" method="post"> <input type="hidden" name="polecenie" value="dodaj_wiadomosc_przetwarzaj" /> <input type="hidden" name="adresat" value="-1" /> Tytu³: <input type="text" name="tytul" size="80" /><br> Tre¶æ:<br>
<textarea name="tresc" rows="20" cols="80"> </textarea><br> Obrazek dot. wiadomo¶ci (format jpg, nie wiêkszy ni¿ 500kB, najwiêkszy wymiar bêdzie zmniejszony do 600 pikseli):<br> <input type="hidden" name="MAX_FILE_SIZE" value="500000"> <input name="obrazek" type="file"><br /> <button type="reset" name="reset"> Skasuj </button> <input type="submit" value="Dodaj wiadomo¶æ."> </form>
Any ideas?
Add this to your form
enctype='multipart/form-data'
<form action="/PW/dydaktyka/index.php?dokument_id=admin" method="post" enctype="multipart/form-data'">
Yes, that was it! Now it works. Thank You.