tags:

views:

14

answers:

1

I want to Upload picture to my web server.

$newname = dirname(__FILE__).'/upload/'.$filename;

The code above would add my picture to folder like this:

www.something.com/admin/upload

How could I get my file to the correct folder:

www.something.com/upload

As you see, it should go one forder back.

The complety code is found on:

http://www.webcheatsheet.com/PHP/file_upload.php

+5  A: 
$newname = realpath(dirname(__FILE__).'/../upload').'/'.$filename;
reko_t