Re: Writing a file from a Sub-Domain form to Upper Domain
| From: | Stuart Dallas | Date: | Wed, 20 Aug 2014 17:56:50 +0000 |
| Subject: | Re: Writing a file from a Sub-Domain form to Upper Domain | ||
| References: | 1 2 3 4 5 6 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-323764@lists.php.net to get a copy of this message | ||
On 20 August 2014 18:53, Don Wieland <donw@dwdataconcepts.com> wrote:
>
> On Aug 20, 2014, at 10:49 AM, Stuart Dallas wrote:
>
> > $directory = dirname(__FILE__).'../../../media/images/';
> >
> > And check the path in the error message is correct.
>
> When i do this I get this error:
>
> Warning:
>
> move_uploaded_file(/home/rtsadven/public_html/wrightcheck/admin/resources/php../../../media/images/pic2.jpg):
> failed to open stream: No such file or directory in
> /home/rtsadven/public_html/wrightcheck/admin/resources/php/upload_image.php
> on line 40 Warning: move_uploaded_file(): Unable to move '/tmp/php3buVDQ'
> to
>
> '/home/rtsadven/public_html/wrightcheck/admin/resources/php../../../media/images/pic2.jpg'
> in
> /home/rtsadven/public_html/wrightcheck/admin/resources/php/upload_image.php
> on line 40
>
My bad. Add a / before the first .. on that line:
$directory = dirname(__FILE__).'/../../../media/images/';
However, from that error message you can see the full path that will be
generated:
/home/rtsadven/public_html/wrightcheck/admin/resources/php/../../../media/images/pic2.jpg
Or, normalised:
/home/rtsadven/public_html/wrightcheck/media/images/pic2.jpg
Is that the right path?
-Stuart
--
Stuart Dallas
3ft9 Ltd
http://3ft9.com/