Nemáte někdo funkční kod na nahrávání souborů na web na určité místo?
Fórum › PHP
Upload souboru (aspon 5MB)

zkus tohle:
za prvé bys měl mít takovejhle formulář:
echo "<form enctype='multipart/form-data'> action='".$_SERVER["PHP_SELF"]."' method='post'>n";
echo "<input name='userfile' type='file' size=40>n";
echo "<input type='submit' value='vložit soubor'>n";
echo "</form>nn";
a pak ho zpracovat:
$uploaddir = $cesta;
$uploadfile = $uploaddir . basename($_FILES['userfile']['name']);//
$typsouboru = $_FILES['userfile']['type'];
move_uploaded_file($_FILES['userfile']['tmp_name'], $uploadfile);
a nezapomeň adresaři, kam se ti to bude nahrávat, přidělit příslušná práva
tak sem ten zdroják dal na web a když sem to zkoušel vypsalo mi to tuhle chybovou hlášku
Warning: move_uploaded_file(08-subor ini - 141205.rar) [function.move-uploaded-file.php]: failed to open stream: Permission denied in /home/free/ic.cz/c/cs-racing/root/www/upload1.php on line 20
Warning: move_uploaded_file() [function.move-uploaded-file.php]: Unable to move '/tmp/phponsnYi' to '08-subor ini - 141205.rar' in /home/free/ic.cz/c/cs-racing/root/www/upload1.php on line 20
To jsou prave ta pristupova prava. Vem si nejakeho FTP klienta a nastav je tam.
a jak... mám IW FTP
Tenhle klient neznam, ale zkus si oznacit tu slozku a klepnout na ni pravym tlacikem. Tam by melo byt neco jako chmod nebo properties a tam se to nastavuje.
Ja pouzivam Total Commandera a tam je to v horni liste [i]soubor->zmena atributu...[/i] a tam se zaskrtou vsechny checkboxy nebo se vypise 777. Nebo zkus prikazovou radku [i] chmod 777 nazev_adresare[/i] .
hmm tak sem to nastavil v Total Commanderu.. IW FTP tato možnost chybí
jinak ten kod co sem měl byl dobrej. Jenom holt na ic.cz nedostanu tak velkej soubor přes upload :'(
Keby si mal vlastny server tak by stacilo pozmenit konfiguracne direktivy pre maximalny upload a islo by to ale na webhostingu takuto moznost nemas :(
p.s. Robi sa to cez upload_max_filesize(integer)M
Vychodzia hodnota je 2MB
tak sem koukal a ic.cz víc než 2MB u Freehostingu nedaj
na wz - mam dojem ze tam maj 5MB, ale nevim to jiste....

Přidej příspěvek
Ano, opravdu chci reagovat → zobrazí formulář pro přidání příspěvku
×Vložení zdrojáku
×Vložení obrázku
×Vložení videa
































Uživatelé prohlížející si toto vlákno
Podobná vlákna
Upload souboru — založil Blujacker
Upload objemných souborů — založil psenik
Upload více souborů — založil pecan987
Upload souborů na server — založil dragon124
Upload souboru. Složitější. — založil psenik
Moderátoři diskuze