| Autor | Zpráva | ||
|---|---|---|---|
| Anonymní Profil * |
#1 · Zasláno: 15. 8. 2006, 09:31:25
Nevíte někdo kde bych našel již hotový PHP scritp na upload bez použití databáze.
|
||
| Hugo Profil |
#2 · Zasláno: 15. 8. 2006, 10:04:01
|
||
| Anonymní Profil * |
#3 · Zasláno: 15. 8. 2006, 12:29:25
Já spíš myslel nějaký konkrétní php skrypt.
|
||
| Hugo Profil |
#4 · Zasláno: 15. 8. 2006, 12:49:20
Anonymní
Tak pohledej, na resourceindex jich je hromada. Nikdo jiný to za tebe hledat nebude. |
||
| Anonymní Profil * |
#5 · Zasláno: 15. 8. 2006, 13:43:25
To je mi jasný. Já myslel jestli někdo nemá zkušenost nebo jestli někdo podobný skript používá a má s nim dobré zkušenosti.
|
||
| Hugo Profil |
#6 · Zasláno: 15. 8. 2006, 13:51:37
Já používám svůj skript a jsem spokojen :-). Plánuju ho vystavit na netu, ale momentálně není čas.
|
||
| Anonymní Profil * |
#7 · Zasláno: 15. 8. 2006, 14:46:34
Už jsem jich několik vyzkoušel např. tento:
<? //user defined variables $abpath = "/PHP2/images"; //Absolute path to where images are uploaded. No trailing slash $sizelim = "no"; //Do you want size limit, yes or no $size = "2500000"; //What do you want size limited to be if there is one //all image types to upload $cert1 = "image/pjpeg"; //Jpeg type 1 $cert2 = "image/jpeg"; //Jpeg type 2 $cert3 = "image/gif"; //Gif type $log = ""; $random1 = rand(1, 99999999); $random2 = rand(1, 99999999); $random3 = rand(1, 99999999); $random4 = rand(1, 99999999); $random5 = rand(1, 99999999); //begin upload 1 //checks if file exists if ($img1_name == "") { $log .= "No file selected for upload 1<br>"; } if ($img1_name != "") { //checks if file exists if (file_exists("$abpath/$img1_name")) { $log .= "File 1 already existed<br>"; } else { //checks if files to big if ($sizelim == "yes") { if ($img1_size > $size) { $log .= "File 1 was too big<br>"; } } //Checks if file is an image if (($img1_type == $cert1) or ($img1_type == $cert2) or ($img1_type == $cert3)) { if (($img1_type == $cert1) or ($img1_type == $cert2)) { $img1_name = $random1 . ".jpeg"; } if ($img1_type == $cert3) { $img1_name = $random1 . ".gif"; } @copy($img1, "$abpath/$img1_name") or $log .= "Couldn't copy image 1 to server<br>"; if (file_exists("$abpath/$img1_name")) { $log .= "File 1 was uploaded<br>"; } } else { $log .= "File 1 is not an image<br>"; } } } //checks if file exists if ($img2_name == "") { $log .= "No file selected for upload 2<br>"; } if ($img2_name != "") { //checks if file exists if (file_exists("$abpath/$img2_name")) { $log .= "File 2 already existed<br>"; } else { //checks if files to big if ($sizelim == "yes") { if ($img2_size > $size) { $log .= "File 2 was too big]<br>"; } } //Checks if file is an image if (($img2_type == $cert1) or ($img2_type == $cert2) or ($img2_type == $cert3)) { if (($img2_type == $cert1) or ($img2_type == $cert2)) { $img2_name = $random2 . ".jpeg"; } if ($img2_type == $cert3) { $img2_name = $random2 . ".gif"; } @copy($img2, "$abpath/$img2_name") or $log .= "Couldn't copy image 2 to server<br>"; if (file_exists("$abpath/$img2_name")) { $log .= "File 2 was uploaded<br>"; } } else { $log .= "File 2 is not an image<br>"; } } } if ($img3_name == "") { $log .= "No file selected for upload 3<br>"; } if ($img3_name != "") { //checks if file exists if (file_exists("$abpath/$img3_name")) { $log .= "File 3 already existed<br>"; } else { //checks if files to big if ($sizelim == "yes") { if ($img3_size > $size) { $log .= "File 3 was too big<br>"; } } //Checks if file is an image if (($img3_type == $cert1) or ($img3_type == $cert2) or ($img3_type == $cert3)) { if (($img3_type == $cert1) or ($img3_type == $cert2)) { $img3_name = $random3 . ".jpeg"; } if ($img3_type == $cert3) { $img3_name = $random3 . ".gif"; } @copy($img3, "$abpath/$img3_name") or $log .= "Couldn't copy image 3 to server<br>"; if (file_exists("$abpath/$img3_name")) { $log .= "File 3 was uploaded<br>"; } } else { $log .= "File 3 is not an image<br>"; } } } if ($img4_name == "") { $log .= "No file selected for upload 4<br>"; } if ($img4_name != "") { //checks if file exists if (file_exists("$abpath/$img4_name")) { $log .= "File 4 already existed<br>"; } else { //checks if files to big if ($sizelim == "yes") { if ($img4_size > $size) { $log .= "File 4 was too big<br>"; } } //Checks if file is an image if (($img4_type == $cert1) or ($img4_type == $cert2) or ($img4_type == $cert3)) { if (($img4_type == $cert1) or ($img4_type == $cert2)) { $img4_name = $random4 . ".jpeg"; } if ($img4_type == $cert3) { $img4_name = $random4 . ".gif"; } @copy($img4, "$abpath/$img4_name") or $log .= "Couldn't copy image 4 to server<br>"; if (file_exists("$abpath/$img4_name")) { $log .= "File 4 was uploaded<br>"; } } else { $log .= "File 4 is not an image<br>"; } } } if ($img5_name == "") { $log .= "No file selected for upload 5<br>"; } if ($img5_name != "") { //checks if file exists if (file_exists("$abpath/$img5_name")) { $log .= "File 5 already existed<br>"; } else { //checks if files to big if ($sizelim == "yes") { if ($img5_size > $size) { $log .= "File 5 was too big<br>"; } } //Checks if file is an image if (($img5_type == $cert1) or ($img5_type == $cert2) or ($img5_type == $cert3)) { if (($img5_type == $cert1) or ($img5_type == $cert2)) { $img5_name = $random5 . ".jpeg"; } if ($img1_type == $cert3) { $img5_name = $random5 . ".gif"; } @copy($img5, "$abpath/$img5_name") or $log .= "Couldn't copy image 5 to server<br>"; if (file_exists("$abpath/$img5_name")) { $log .= "File 5 was uploaded<br>"; } } else { $log .= "File 5 is not an image<br>"; } } } ?> <html> <head> <title>Image Report</title> </head> <body> <p>Log:<br> <? echo "$log"; ?> </p> <body> <html> spustil jsem potom subor img.html. Ale když jsem se něco pokusil skopírovat do tý složky s názvem images a cmotm na 777, napíše mi to Couldn't copy image 1 to server. A tak je to většinou u všech. |
||
| djlj Profil |
#8 · Zasláno: 15. 8. 2006, 15:40:39
složky s názvem images
Ta ložka je ale /PHP2/images. |
||
| Anonymní Profil * |
#9 · Zasláno: 15. 8. 2006, 16:41:11
djlj:
No a co? |
||
| djlj Profil |
#10 · Zasláno: 15. 8. 2006, 16:42:29
No a co?
No a to, že to, soudě dle tvého předposledního příspěvku, kopíruješ do neexistující složky. |
||
| ronnie Profil |
#11 · Zasláno: 15. 8. 2006, 17:07:51
Pokud jde jen o upload souborů, tak třeba http://weblog.ronnieweb.net/?text=57-oop-trida-pro-prenaseni-souboru-n a-server :)
|
||
| Anonymní Profil * |
#12 · Zasláno: 15. 8. 2006, 19:25:11
djlj:
no tu složku mam vytvořenou |
||
|
Časová prodleva: 20 let
|
|||
Toto téma je uzamčeno. Odpověď nelze zaslat.
0