0

I have write a php code that upload the image to web/uploads/slider which i get through

$dir = $this->container->getParameter('assetic.write_to') . '\uploads\slider';

In my local server(windows apache) it works fine and upload as expected but the problem comes when i used it in live server it creates a folder name 'web\uploads\slider' in a project folder and upload a file in it

1
  • What problems occur? Please be more specific! Commented Mar 21, 2015 at 20:03

1 Answer 1

2

You need to use forward slashes:

$dir = $this->container->getParameter('assetic.write_to') . '/uploads/slider';

Backslashes only work on Windows OS but forward slashes work on any OS (including Windows).

Sign up to request clarification or add additional context in comments.

1 Comment

exactly the problem is solved. I have used php constant DIRECTORY_SEPARATOR

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.