File Upload: PRoblem with upload directory

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
trainspotter
Forum Newbie
Posts: 1
Joined: Sat Jun 26, 2004 2:23 am

File Upload: PRoblem with upload directory

Post by trainspotter »

hi folks,

i have a more-or-less newbie problem:

i have a upload directory given by my provider which is outside the home-range:

/www/home/index.php = http://www.websitename.com/index.php
/www/uploads

I can put files via a form to to uploads-directory but I can't adress them with html because they are out side the website. I also can't move them with copy or move_upload_file to another directory because I don't have the permissions.

how can i adress the files?

thanks for feedback

marcell
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

hmmm using a script redirector of sorts..

create a script that takes the filename as an argument.

here's some pseudo code:

Code: Select all

if filename exists
{
  figure out mime-type
  send appropriate headers
  readfile() the filename
}
otherwise
{
  say "no file"
}
Post Reply