Code Monkey home page Code Monkey logo

Comments (4)

erikreagan avatar erikreagan commented on July 18, 2024

I don't understand the problem. Can't you just write out the path correctly with back slashes?

from ee-master-config.

Natetronn avatar Natetronn commented on July 18, 2024

I was thinking I needed to write the whole path with backslashes though, looks like this will in fact work:

    $env_config['upload_preferences'] = array(
        1 => array(
             'name'        => 'Uploads',
             'server_path' => $images_path . '\uploads',
             'url'         => $images_url  . '/uploads/'
        )
    );

which returns:

C:/wamp/www/mysite/public_html/images\uploads

Do you know if the backslash will also work on Unix based file systems? I'm going to test it though, maybe you know from memory.

Thanks

from ee-master-config.

erikreagan avatar erikreagan commented on July 18, 2024

Do you know if the backslash will also work on Unix based file systems? I'm going to test it though, maybe you know from memory.

I'm not sure. I haven't had to deal with *nix/Windows path differences in EE (ever). If you find out something concrete let me know though :)

from ee-master-config.

Natetronn avatar Natetronn commented on July 18, 2024

Erik this is what I came up with and seems to be working though, I'm not sure if this is the best way to approch:

    $slash_type = (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') ? '\\' : '/';    
    $env_config['upload_preferences'] = array(
        1 => array(
             'name'        => 'Page Uploads',
             'server_path' => $images_path . $slash_type.'uploads'.$slash_type.'page/',
             'url'         => $images_url  . '/uploads/page/'
        )
    );

from ee-master-config.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.