From 8206257a146a93722ef5251e057866c8d4d5505c Mon Sep 17 00:00:00 2001 From: rojaro <> Date: Wed, 30 Sep 2009 20:12:06 +0000 Subject: merged patch from ctrlaltca which fixes the 'TActiveFileUpload is not "thread safe"' issue #90 --- framework/Web/UI/ActiveControls/TActiveFileUpload.php | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'framework/Web/UI') diff --git a/framework/Web/UI/ActiveControls/TActiveFileUpload.php b/framework/Web/UI/ActiveControls/TActiveFileUpload.php index b935936b..3b8212b9 100755 --- a/framework/Web/UI/ActiveControls/TActiveFileUpload.php +++ b/framework/Web/UI/ActiveControls/TActiveFileUpload.php @@ -96,7 +96,7 @@ class TActiveFileUpload extends TFileUpload implements IActiveControl, ICallback * @param TEventParameter event parameter to be passed to the event handlers */ public function onFileUpload($param){ - if ($this->_flag->getValue() && $this->getPage()->getIsPostBack()){ + if ($this->_flag->getValue() && $this->getPage()->getIsPostBack() && $param == $this->_target->getUniqueID()){ // save the file so that it will persist past the end of this return. $localName = str_replace('\\', '/', tempnam(Prado::getPathOfNamespace($this->getTempPath()),'')); parent::saveAs($localName); @@ -190,6 +190,16 @@ EOS; } } + /** + * Raises postdata changed event. + * This method calls {@link onFileUpload} method + * This method is primarily used by framework developers. + */ + public function raisePostDataChangedEvent() + { + $this->onFileUpload($this->getPage()->getRequest()->itemAt('tempActiveUploadField')); + } + /** * Publish the javascript */ -- cgit v1.2.3