[TYPO3-mvc] Strange problem with f:form.upload
Robert Schneider
r.schneider at artworx.at
Thu Aug 2 12:01:10 CEST 2012
Hi,
I have already solved it but wanted to let other know which problem I had.
I have a Fluid form with an f:form.upload element which had the property
attribut. It was wondering about that I had to use the property
attribute since this was not a real property of my model object.
However, it worked fine on my local system (Windows, Typo3 4.7.1). I
could access the file with the global variable $_FILES. Strange was,
that the same did not work on the remote host (Linux, same Typo3).
There, I always got the error message 'The value must be of type
"Tx...", but was of type "NULL". Property ...'.
The systems should be identical, more or less, at least my extension is
identical. I cannot imagine that it is a configuration issue. And I
don't think that it has anything to do with the file system. I have no
clue why the behaviour differ.
But the solution was: Not using the property, rather the name attribute
in the Fluid template. What is of course more logical, since it is no
real property. Of course I had to change the access of the $_FILES
variable. Instead of:
$_FILES['tx_myext']['name']['tx_mymodelclass']['myproperty_value'])
$_FILES['tx_myext']['tmp_name']['tx_mymodelclass']['myproperty_value'])
I use now:
$_FILES['tx_myext']['name']['myname_value'])
$_FILES['tx_myext']['tmp_name']['myname_value'])
(myproperty_value was the value of the property attribute
myname_value is the value of the name attribute)
If anyone could explain that, do that please.
Robert
More information about the TYPO3-project-typo3v4mvc
mailing list