Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ftpClient mkdir #13

Open
ghost opened this issue Jan 25, 2018 · 2 comments
Open

ftpClient mkdir #13

ghost opened this issue Jan 25, 2018 · 2 comments

Comments

@ghost
Copy link

ghost commented Jan 25, 2018

        /*
         * Path is '/srv/clips/1/5/0/5/7/vid/059468/arbm'
         * Explode is
                array (
                  0 => '',
                  1 => 'srv',
                  2 => 'clips',
                  3 => '1',
                  4 => '5',
                  5 => '0',
                  6 => '5',
                  7 => '7',
                  8 => 'vid',
                  9 => '059468',
                  10 => 'arbm',
                )
         */
        foreach ($parts as $part) {
            
            $part = $part=='' ? '/' : $part;
            ...

I had to add the last line, since chdir('') fails.

If I send target without leading slash, it the folder gets created under the current root.

In retrospect it seems obvious: you want me to chdir to '/srv' then mkdir.

But I am calling putAll(), and I don't necessarily know what the root/leading portion is.

Is there any problem with this suggested fix?

@ihorchepurnyi
Copy link
Contributor

Hi, can you create PR for this issue?

@ghost
Copy link
Author

ghost commented Jan 25, 2018

I am afraid not, sorry. Not today, not soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant