ist-yii-cfile icon indicating copy to clipboard operation
ist-yii-cfile copied to clipboard

resolveDestPath doesn't work on Windows

Open durach opened this issue 14 years ago • 1 comments

if on windows we run:

->set('data/'temp/file.jpg')->move('data/images/image.jpg')

execution fails w/o error. It probably returns false, but I expect CException.

It fails because resolveDestPath doesn't work correctly on Windows. In my example it will return

'data/temp\data/temp/file.jpg'

This happens because of the following lines on code:

if (strpos($fileDest, DIRECTORY_SEPARATOR)===false)
            return $this->dirname.DIRECTORY_SEPARATOR.$fileDest;

Which probably intended to work as ->set('/path/to/filename')->rename('anotherfilename')

We used to use '/' in all paths in our code and PHP functions work with it correctly.

durach avatar Aug 16 '11 08:08 durach

I'll look at that next time I happen to Windows %)

Do not forget: it's GitHub — you are free to fork the project and make the appropriate changes.

idlesign avatar Aug 18 '11 03:08 idlesign