uploadscript

Gestart doorLars10 reacties99 weergaven

11 berichten · pagina 1 van 1

Lars

Lid · Topicstarter

Berichten
3.416
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Hallo,

Ik zoek een goed werkend upload scriptje waarmee ik tracks kan uploaden.
Heeft iemand een simpel upload scriptje voor me liggen?

Alvast bedankt.

MVG,

Lars K.
0
Berichten
5.737
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Ik heb er geen liggen maar als je er niet uit komt hier moet je bij aanvragen een topic openen en er punten voor geven
denk namelijk niet dat het zo gratis simpel kan..
0
Lars

Lid · Topicstarter

Berichten
3.416
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
upload scriptjes zijn heel simpel.
Is enkel voor me zelf om niet via ftp bestandjes te hoeven uploaden geen complete site wink
0
Berichten
6.485
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
op google staan er heel veel
0
Berichten
8.602
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Edit: Handleiding:
Uitleg
Met dit script kunnen mensen dingen uploaden naar jouw server.
Je kunt zelf de limieten instellen waar alle bestanden aan moeten voldoen.

Installatie
- Verander de 3 bovenste variabelen
- Upload het bestand
- Maak de map aan, waar alle bestanden in komen te staan
- Geef die map schrijfrechten (chmod 777)

Code voor upload.php
Je kunt hem nog aanpassen.

[COLOR= #0000BB]<?[/COLOR] 
[COLOR= #FF8000]//verander de onderstaande gegevens [/COLOR]

[COLOR= #0000BB]$locatie[/COLOR][COLOR= #007700]=[/COLOR][COLOR= #DD0000]"images/"[/COLOR][COLOR= #007700];[/COLOR] [COLOR= #FF8000]//of een andere map, vergeet niet de w-rechten [/COLOR]
[COLOR= #0000BB]$toegestaan[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #DD0000]"jpg, gif, png"[/COLOR][COLOR= #007700];[/COLOR] [COLOR= #FF8000]// extensies die toegestaan zijn [/COLOR]
[COLOR= #0000BB]$max_size[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]15000[/COLOR][COLOR= #007700];[/COLOR] [COLOR= #FF8000]//maximale grootte van het bestand in bytes 

//stop met veranderen [/COLOR]

[URL="http://www.php.net/set_time_limit"]set_time_limit[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]0[/COLOR][COLOR= #007700]);[/COLOR] 

[URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/isset"]isset[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]upload[/COLOR][COLOR= #007700]])) 
{[/COLOR] 
    [URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/is_uploaded_file"]is_uploaded_file[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_FILES[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]bestand[/COLOR][COLOR= #007700]][[/COLOR][COLOR= #DD0000]tmp_name[/COLOR][COLOR= #007700]])) 
    {[/COLOR] 
        [COLOR= #0000BB]$extensie_bestand[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/pathinfo"]pathinfo[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_FILES[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]bestand[/COLOR][COLOR= #007700]][[/COLOR][COLOR= #DD0000]name[/COLOR][COLOR= #007700]]);[/COLOR] 
        [COLOR= #0000BB]$extensie_bestand[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]$extensie_bestand[/COLOR][COLOR= #007700][[/COLOR]extension[COLOR= #007700]];[/COLOR] 

        [COLOR= #0000BB]$extensies_toegestaan[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/explode"]explode[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]", "[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]$toegestaan[/COLOR][COLOR= #007700]);[/COLOR] 

        [URL="http://www.php.net/for"]for[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$i[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]0[/COLOR][COLOR= #007700];[/COLOR] [COLOR= #0000BB]$i[/COLOR] [COLOR= #007700]<[/COLOR] [URL="http://www.php.net/count"]count[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$extensies_toegestaan[/COLOR][COLOR= #007700]);[/COLOR] [COLOR= #0000BB]$i[/COLOR]  [COLOR= #007700]) 
        {[/COLOR] 
            [URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$extensies_toegestaan[/COLOR][COLOR= #007700][[/COLOR][COLOR= #0000BB]$i[/COLOR][COLOR= #007700]] ==[/COLOR] [COLOR= #DD0000]"$extensie_bestand"[/COLOR][COLOR= #007700]) 
            {[/COLOR] 
                [COLOR= #0000BB]$ok[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]1[/COLOR][COLOR= #007700]; 
            } 
        }[/COLOR] 

        [URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$ok[/COLOR] [COLOR= #007700]==[/COLOR] [COLOR= #0000BB]1[/COLOR][COLOR= #007700]) 
        {[/COLOR] 
            [URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_FILES[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]bestand[/COLOR][COLOR= #007700]][[/COLOR][COLOR= #DD0000]size[/COLOR][COLOR= #007700]]>[/COLOR][COLOR= #0000BB]$max_size[/COLOR][COLOR= #007700]) 
            {[/COLOR] 
                [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"Het bestand is te groot, de maximale grootte is: <b>$max_size</b>"[/COLOR][COLOR= #007700];[/COLOR] 
                [URL="http://www.php.net/exit"]exit[/URL][COLOR= #007700]; 
            }[/COLOR] 

            [URL="http://www.php.net/if"]if[/URL][COLOR= #007700](![/COLOR][URL="http://www.php.net/move_uploaded_file"]move_uploaded_file[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_FILES[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]bestand[/COLOR][COLOR= #007700]][[/COLOR][COLOR= #DD0000]tmp_name[/COLOR][COLOR= #007700]],[/COLOR] 
            [COLOR= #0000BB]$locatie[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$_FILES[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]bestand[/COLOR][COLOR= #007700]][[/COLOR][COLOR= #DD0000]name[/COLOR][COLOR= #007700]])) 
            {[/COLOR] 
                [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"het bestand kan niet worden verplaatst"[/COLOR][COLOR= #007700];[/COLOR] 
                [URL="http://www.php.net/exit"]exit[/URL][COLOR= #007700]; 
            }[/COLOR] 

            [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"Het bestand "[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$_FILES[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]bestand[/COLOR][COLOR= #007700]][[/COLOR][COLOR= #DD0000]name[/COLOR][COLOR= #007700]].[/COLOR][COLOR= #DD0000]" is geupload<br> 
            <a href="[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$locatie[/COLOR][COLOR= #007700].[/COLOR][COLOR= #DD0000]""[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$_FILES[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]bestand[/COLOR][COLOR= #007700]][[/COLOR][COLOR= #DD0000]name[/COLOR][COLOR= #007700]].[/COLOR][COLOR= #DD0000]" target=_blank>Klik hier om het te bekijken</a>"[/COLOR][COLOR= #007700]; 
        }[/COLOR] 
        [URL="http://www.php.net/else"]else[/URL] 
        [COLOR= #007700]{[/COLOR] 
            [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"Verkeerde extentie, de toegestane extensies zijn: <b>$toegestaan</b>"[/COLOR][COLOR= #007700]; 
        } 
    }[/COLOR] 
    [URL="http://www.php.net/else"]else[/URL] 
    [COLOR= #007700]{[/COLOR] 
        [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"Het uploaden is mislukt"[/COLOR][COLOR= #007700]; 
    } 

}[/COLOR] 

?> 
<br><br> 
<form method="post" action="<?=$_SERVER[PHP_SELF]?>" enctype="multipart/form-data"> 
<input type="file" name="bestand"><br> 
<input type="submit" name="upload" value="uploaden"> 
</form>
0
Berichten
8.602
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Is ie goed?
0
Berichten
6.485
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
die ken ik al? en er is geen gallery bij
0
Berichten
248
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
ooh je wilt met galery pb me ik verkoop met voor 0.1 punt
0
Berichten
6.485
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
ik hoef hem niet -.-
0
Lars

Lid · Topicstarter

Berichten
3.416
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Ga hem zo is testen in ieder geval bedankt smile
0
Berichten
8.602
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Lars schreef:
Ga hem zo is testen in ieder geval bedankt smile
Je moet de bestanden die mogen upgeload worden wel nog aanpassen smile
0

Jouw reactie

Deel je idee, stel een vraag of help een ander verder.

Editor laden…

Praat mee met de One2xs-community.

Inloggen om te reageren