cheesegrits
Support Gopher
There seems to be a little bugette in uploaded images on Windows based servers which prevents the image from being displayed when editing or viewing the form.
I think the problem is during upload, when the $destFile is processed in _uploadIndividualFile(), around line 2560 in fabrik.class.php. The code doesn't take account of the \ instead of / in the $destFile, so the switcheroonie of mosConfig_absolute_path for mosConfig_live_site doesn't work. So when the form gets rendered, the 'img src' ends up with a full URI followed by a whole Windows absolute path, which doesn't work too well.
The fix seems to be:
I'm also suspicious of this code a few lines up from the above, where it does the fileIncrement handling:
Looks like that will need tweaking to use the right path delimiter as well.
And of course, these fiixes don't help with any images uploaded prior to the above fix, so for full backward compat you would probably want to put some special case handling into drawFileUpload() as well. Basically do the same switcheroonie again, to catch any that are still set to C:\path\to\images instead of http://mysite.com/uri/to/images.
-- hugh
I think the problem is during upload, when the $destFile is processed in _uploadIndividualFile(), around line 2560 in fabrik.class.php. The code doesn't take account of the \ instead of / in the $destFile, so the switcheroonie of mosConfig_absolute_path for mosConfig_live_site doesn't work. So when the form gets rendered, the 'img src' ends up with a full URI followed by a whole Windows absolute path, which doesn't work too well.
The fix seems to be:
Code:
mosChmod( $destFile );
// $$$ hugh
$dosFreeDestFile = str_replace('\','/',$destFile);
$this->_form->_data[$elName] = str_replace( $mosConfig_absolute_path, $mosConfig_live_site, $dosFreeDestFile );
I'm also suspicious of this code a few lines up from the above, where it does the fileIncrement handling:
Code:
//get the filename with out the path
$newFileName = explode( "/", $destFile );
$newFileName = end( $newFileName );
Looks like that will need tweaking to use the right path delimiter as well.
And of course, these fiixes don't help with any images uploaded prior to the above fix, so for full backward compat you would probably want to put some special case handling into drawFileUpload() as well. Basically do the same switcheroonie again, to catch any that are still set to C:\path\to\images instead of http://mysite.com/uri/to/images.
-- hugh