Re: mkdir no such file or directory [message #181414 is a reply to message #181412] |
Wed, 15 May 2013 19:31 |
Thomas 'PointedEars'
Messages: 701 Registered: October 2010
Karma:
|
Senior Member |
|
|
Robert Heller wrote:
> "Bhushan N.N" wrote:
>> ie, if my website is called example, the structure will be
>>
>> example
>> index.php
>> upload.php
>> search.php
>> uploads
>> 12209214
>> somefile.txt
>> 31231203
>> otherfile.txt
>> about.php
>> contact.php
>
> That means you don't want "/uploads"! If the mkdir code is in upload.php,
> then you really do want:
>
> $directory = dirname(__FILE__) . "/uploads/" . time();
From PHP 5.3 on they may want to use
$directory = __DIR__ . "/uploads/" . time();
instead. However, see my other answer as to why either approach is not a
good idea.
PointedEars
--
Anyone who slaps a 'this page is best viewed with Browser X' label on
a Web page appears to be yearning for the bad old days, before the Web,
when you had very little chance of reading a document written on another
computer, another word processor, or another network. -- Tim Berners-Lee
|
|
|