Filepicker - getDir() [message #7428] |
Mon, 23 March 2020 17:11 |
htManager
Messages: 434 Registered: May 2014
|
Senior Member |
|
|
I have problems with some filepicker tasks because of the DIRECTORY_SEPARATOR in an XAMPP installation on my notebook. Some of the tasks work fine but some use the '\' as separator in front of the picture file and so is in line 120 in the std.filepicker1.inc no correct filepath found and an error will be generated. I use the same directory where the pictures are stored for the tasks which work and for those which fail. Do I have to take attention to something special?
|
|
|
Re: Filepicker - getDir() [message #7429 is a reply to message #7428] |
Tue, 24 March 2020 05:40 |
AJM
Messages: 2368 Registered: April 2006 Location: Surrey, UK
|
Senior Member |
|
|
Line 120 is as follows:
$fileobject->picker_child_dir = $subdir.DIRECTORY_SEPARATOR.$_GET['select'];
Note that DIRECTORY_SEPARATOR is a predefined constant which is set automatically to either '\' or '/' depending on your operating system. If you have a path which cannot be found does it contain other separators which are invalid for that OS?
Tony Marston
http://www.tonymarston.net
http://www.radicore.org
|
|
|
|
Re: Filepicker - getDir() [message #7431 is a reply to message #7430] |
Wed, 25 March 2020 06:54 |
AJM
Messages: 2368 Registered: April 2006 Location: Surrey, UK
|
Senior Member |
|
|
Windows can use either '\' or '/' as the directory separator whereas linux will only allow '/', so the code which converts '\' to '/.' is not an issue.
Your actual problem is shown in the message "Method 'getDir' does not exist in standard object" which means that I did not include the updated version of std.table.class.inc in my last release. I have attached the latest version to this message.
Tony Marston
http://www.tonymarston.net
http://www.radicore.org
|
|
|
|
|
|
|
|
|
Re: Filepicker - getDir() [message #7438 is a reply to message #7437] |
Fri, 27 March 2020 16:43 |
htManager
Messages: 434 Registered: May 2014
|
Senior Member |
|
|
I thought that it would be in the _cm_filePickerSelect ($selection) method, but the selection will not be shown in this method. Where would it be best?
In the filepicker selection screen you can't see the images anymore. See attached screenshots.
[Updated on: Sat, 28 March 2020 05:36] Report message to a moderator
|
|
|
|
|
|
|
|
|
|
|
|
Re: Filepicker - getDir() [message #7448 is a reply to message #7447] |
Wed, 01 April 2020 05:37 |
AJM
Messages: 2368 Registered: April 2006 Location: Surrey, UK
|
Senior Member |
|
|
It would appear that somewhere in the processing I changed the relative path to an absolute path, so I will fix this in the next release which will follow shortly. In the meantime you can try the following code in the _cm_popupReturn() method:
$selection = $this->picker_subdir .'/' .basename($selection);
Tony Marston
http://www.tonymarston.net
http://www.radicore.org
|
|
|
|
|
|
|