Bluehost.com Web Hosting $6.95

Upload in different directories

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 ...


Go Back   Usenet Forums > PHP Programming Forums > alt.comp.lang.php

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 08-15-2003
Volhouden
 
Posts: n/a
Default Upload in different directories

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


Reply With Quote
  #2 (permalink)  
Old 08-15-2003
Volhouden
 
Posts: n/a
Default Re: Upload in different directories

> 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


Reply With Quote
  #3 (permalink)  
Old 08-15-2003
Nikolai Chuvakhin
 
Posts: n/a
Default Re: Upload in different directories

"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
Reply With Quote
  #4 (permalink)  
Old 08-16-2003
Wim Hekken ;-\)
 
Posts: n/a
Default Re: Upload in different directories

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 ;-)


Reply With Quote
  #5 (permalink)  
Old 08-16-2003
Volhouden
 
Posts: n/a
Default Re: Upload in different directories

> 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


Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT +1. The time now is 12:20 PM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0