This is a discussion on Upload in different directories within the alt.comp.lang.php forums, part of the PHP Programming Forums category; I search on the internet and i saw a lot of upload-scripts. But in all you only can give ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
I search on the internet and i saw a lot of upload-scripts. But in all you
only can give 1 directory to put your pictures (or other files) in. On my site i have 3 different driectories. (example: football, swimming and tennis). And i only want to have 1 upload-pae with a <option> where i can choose the directory. Does anyone have a script for this? Greetz Arjan --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.507 / Virus Database: 304 - Release Date: 4-8-2003 |
|
|||
|
> Just use a switch() statement for something like $_POST['upload_dir'] =)
8-S Sorry... I'm php-noob "Ian.H [dS]" <ian@WINDOZEdigiserv.net> schreef in bericht news:20030815155633.174d46ac.ian@WINDOZEdigiserv.n et... > On Fri, 15 Aug 2003 14:45:59 GMT in > <message-id:Hm6%a.109093$0W5.2955388@pollux.casema.net> > "Volhouden" <vraag@maar.nl> wrote: > > > I search on the internet and i saw a lot of upload-scripts. But in all > > you only can give 1 directory to put your pictures (or other files) > > in. > > > > On my site i have 3 different driectories. (example: football, > > swimming and tennis). And i only want to have 1 upload-pae with a > > <option> where i can choose the directory. > > > > Does anyone have a script for this? > > > > Greetz Arjan > > > > > HTH. > > > > Regards, > > Ian > > > [ irrelevant XPs snipped ] > > -- > Ian.H [Design & Development] > digiServ Network - Web solutions > www.digiserv.net | irc.digiserv.net | forum.digiserv.net > Programming, Web design, development & hosting. --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.507 / Virus Database: 304 - Release Date: 4-8-2003 |
|
|||
|
"Volhouden" <vraag@maar.nl> wrote in message
news:<Hm6%a.109093$0W5.2955388@pollux.casema.net>. .. > > I search on the internet and i saw a lot of upload-scripts. But in all you > only can give 1 directory to put your pictures (or other files) in. > > On my site i have 3 different driectories. (example: football, swimming and > tennis). And i only want to have 1 upload-pae with a <option> where i can > choose the directory. > > Does anyone have a script for this? Take the script you are currently using and make two modifications to it: 1. Add a SELECT control insode the HTML form: <SELECT name="destination"> <OPTION value="f">Football <OPTION value="s">Swimming <OPTION value="t">Tennis </SELECT> 2. Find the move_uploaded_file() function. It should look something like this: move_uploaded_file ($file, '/destination/directory'); The first argument is the temporary name of the uploaded file, so you shouldn't modify it. Now edit this line slightly and add a few lines before it: switch ($_POST['destination']) { case 'f': $dest = '/football'; break; case 's': $dest = '/swimming'; break; case 't': $dest = '/tennis'; break; } move_uploaded_file ($file, $dest); That's it, really... Cheers, NC |
|
|||
|
In news:Hm6%a.109093$0W5.2955388@pollux.casema.net,
verblijdde Volhouden<vraag@maar.nl> ons met de volgende onsterfelijke woorden: > I search on the internet and i saw a lot of upload-scripts. But in > all you only can give 1 directory to put your pictures (or other > files) in. > > On my site i have 3 different driectories. (example: football, > swimming and tennis). And i only want to have 1 upload-pae with a > <option> where i can choose the directory. > > Does anyone have a script for this? > > Greetz Arjan > > > --- > Outgoing mail is certified Virus Free. > Checked by AVG anti-virus system (http://www.grisoft.com). > Version: 6.0.507 / Virus Database: 304 - Release Date: 4-8-2003 n je "Engels"en je naam te zien, begrijp jij Nederlands heel goed. Post dan ook je berichten in een .nl. groep in het Nederlands. O ja, je neemt het mijn virusscanner niet kwalijk, dat je mailtje nogmaals is gescand? -- Wim Hekken ;-) |
|
|||
|
> Je virusscanner voegt steeds drue reclameregels aan je mail toe.
Das om aan te geven dat er geen virussen inzitten! ;-) En de reden dat ie er een link in zet is omdat t een gratis scanner is. Trouwens wel een aanrader... VGA! hahaha --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.507 / Virus Database: 304 - Release Date: 4-8-2003 |