Re: mkdir no such file or directory [message #181406 is a reply to message #181403] |
Wed, 15 May 2013 13:51 |
Robert Heller
Messages: 60 Registered: December 2010
Karma:
|
Member |
|
|
At Wed, 15 May 2013 12:38:27 +0000 (UTC) Denis McMahon <denismfmcmahon(at)gmail(dot)com> wrote:
>
> On Tue, 14 May 2013 20:06:19 -0700, Bhushan N.N wrote:
>
>> Here is my code again
>>
>> $filelocation = "/uploads/" . "/" . time();
>> if (mkdir($filelocation,0777,true))
>> {
>> echo("Thank you for uploading the file.");
>> }
>> else {
>> echo("Oops error uploading file.");
>> }
>
> Does /uploads exist on your system?
> If /uploads does exist, has the webserver process got sufficient access
> to create subdirs in it?
> If /uploads does not exist, has the webserver process got sufficient
> access to create it?
>
> Given that creating anything at / usually requires root level access, and
> it's generally not recommended to run web servers as root, I suspect
> access rights might be your problem.
And: maybe the OP *really* means something like:
$filelocation = dirname(__FILE__) . "/uploads/" . "/" . time();
That is, he might really want uploads to be *relative* to files on the
website, rather than a absolute place on the server's file system. (The
'dirname(__FILE__)' is just an example, there might be other possibilities.)
>
--
Robert Heller -- 978-544-6933 / heller(at)deepsoft(dot)com
Deepwoods Software -- http://www.deepsoft.com/
() ascii ribbon campaign -- against html e-mail
/\ www.asciiribbon.org -- against proprietary attachments
|
|
|