File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change 1212use In2code \Powermail \Utility \StringUtility ;
1313use TYPO3 \CMS \Core \Configuration \Exception \ExtensionConfigurationExtensionNotConfiguredException ;
1414use TYPO3 \CMS \Core \Configuration \Exception \ExtensionConfigurationPathDoesNotExistException ;
15+ use TYPO3 \CMS \Core \Type \File \FileInfo ;
1516use TYPO3 \CMS \Extbase \Object \Exception ;
1617use TYPO3 \CMS \Extbase \Persistence \Exception \InvalidQueryException ;
1718use TYPO3 \CMS \Extbase \SignalSlot \Exception \InvalidSlotException ;
@@ -131,11 +132,11 @@ protected function makeFileInstance(
131132 $ file ->setNewName (StringUtility::cleanString ($ originalName ));
132133 $ file ->setUploadFolder ($ this ->getUploadFolder ());
133134 if ($ size === 0 ) {
134- $ size = filesize ($ file ->getNewPathAndFilename ( true ));
135+ $ size = filesize ($ file ->getTemporaryName ( ));
135136 }
136137 $ file ->setSize ((int )$ size );
137138 if ($ type === '' ) {
138- $ type = mime_content_type ( $ file ->getNewPathAndFilename ( true )) ;
139+ $ type = ( new FileInfo ( $ file ->getTemporaryName ()))-> getMimeType () ?: ' application/octet-stream ' ;
139140 }
140141 $ file ->setType ($ type );
141142 $ file ->setUploaded ($ uploaded );
You can’t perform that action at this time.
0 commit comments