Search

When I try to upload a document like txt or rtf with the frontend I’ll get this error.

filemtime(): stat failed for /var/www/g33026/psy-match.nl/HTML/workspaceTest CV rtf.rtf

An error occurred in /var/www/g33026/psy-match.nl/HTML/symphony/lib/toolkit/fields/field.upload.php around line 469

* 464:                 'image/png',
* 465:             );
* 466:             
* 467:             $meta = array();
* 468:             
* 469:             $meta['creation'] = DateTimeObj::get('c', filemtime($file));
* 470:             
* 471:             if(General::in_iarray($type, $imageMimeTypes) && $array = @getimagesize($file)){
* 472:                 $meta['width'] = $array[0];
* 473:                 $meta['height'] = $array[1]; 

Backtrace

* [:0] GenericErrorHandler::handler();
* [/var/www/g33026/psy-match.nl/HTML/symphony/lib/toolkit/fields/field.upload.php:469] filemtime();
* [/var/www/g33026/psy-match.nl/HTML/symphony/lib/toolkit/fields/field.upload.php:377] fieldUpload::getMetaInfo();
* [/var/www/g33026/psy-match.nl/HTML/symphony/lib/toolkit/class.entry.php:147] fieldUpload->processRawFieldData();
* [/var/www/g33026/psy-match.nl/HTML/symphony/lib/toolkit/events/event.section.php:106] Entry->setDataFromPost();
* [/var/www/g33026/psy-match.nl/HTML/symphony/lib/toolkit/events/event.section.php:310] __doit();
* [/var/www/g33026/psy-match.nl/HTML/workspace/events/event.formulieren.php:145] include();
* [/var/www/g33026/psy-match.nl/HTML/workspace/events/event.formulieren.php:141] eventformulieren->__trigger();
* [/var/www/g33026/psy-match.nl/HTML/symphony/lib/toolkit/class.frontendpage.php:549] eventformulieren->load();
* [/var/www/g33026/psy-match.nl/HTML/symphony/lib/toolkit/class.frontendpage.php:233] FrontendPage->processEvents();
* [/var/www/g33026/psy-match.nl/HTML/symphony/lib/toolkit/class.frontendpage.php:63] FrontendPage->__buildPage();
* [/var/www/g33026/psy-match.nl/HTML/symphony/lib/core/class.frontend.php:50] FrontendPage->generate();
* [/var/www/g33026/psy-match.nl/HTML/index.php:25] Frontend->display();

This is a piece of my source:

<div class="uploadfield">
    <label>Voeg uw CV toe bij het formulier</label>
    <input type="file" name="fields[cv]" size="20"/>
</div>

Who is the guy can help me?

What version of symphony are you using?

Version: 2.0.8RC3

As a temporary fix, you can replace:

$meta['creation'] = DateTimeObj::get('c', filemtime($file));

on line 469 of symphony/lib/toolkit/fields/field.upload.php

with:

$meta['creation'] = DateTimeObj::get('c', @filemtime($file));

I’ve changed the pice of code as you told me, but now I get this error:

Column 'size' cannot be null

An error occurred while attempting to execute the following query

    * INSERT INTO `sym_entries_data_182` (`entry_id`, `file`, `mimetype`, `size`, `meta`) VALUES ('186', 'Test CV.doc', 'unknown', NULL, 'a:1:{s:8:"creation";s:25:"2010-08-20T18:02:44+00:00";}')

Backtrace:

    * [/var/www/g33026/psy-match.nl/HTML/symphony/lib/toolkit/class.mysql.php:267] MySQL->__error();
    * [/var/www/g33026/psy-match.nl/HTML/symphony/lib/toolkit/class.mysql.php:211] MySQL->query();
    * [/var/www/g33026/psy-match.nl/HTML/symphony/lib/toolkit/class.entrymanager.php:147] MySQL->insert();
    * [/var/www/g33026/psy-match.nl/HTML/symphony/lib/toolkit/class.entry.php:197] EntryManager->edit();
    * [/var/www/g33026/psy-match.nl/HTML/symphony/lib/toolkit/events/event.section.php:125] Entry->commit();
    * [/var/www/g33026/psy-match.nl/HTML/symphony/lib/toolkit/events/event.section.php:310] __doit();
    * [/var/www/g33026/psy-match.nl/HTML/workspace/events/event.formulieren.php:145] include();
    * [/var/www/g33026/psy-match.nl/HTML/workspace/events/event.formulieren.php:141] eventformulieren->__trigger();
    * [/var/www/g33026/psy-match.nl/HTML/symphony/lib/toolkit/class.frontendpage.php:549] eventformulieren->load();
    * [/var/www/g33026/psy-match.nl/HTML/symphony/lib/toolkit/class.frontendpage.php:233] FrontendPage->processEvents();
    * [/var/www/g33026/psy-match.nl/HTML/symphony/lib/toolkit/class.frontendpage.php:63] FrontendPage->__buildPage();
    * [/var/www/g33026/psy-match.nl/HTML/symphony/lib/core/class.frontend.php:50] FrontendPage->generate();
    * [/var/www/g33026/psy-match.nl/HTML/index.php:25] Frontend->display();

I’d just comment out the entire line, it’ll most likely work then…

No, the line indicates the database is set too strict for the commented out line to work.

If you open up phpmyadmin, and allow the size field of table sym_entries_data_182 to be null, everything should work again.

Inside the phpmyadmin I only have these fields inside the table sym_entries_data_182

  • id
  • entry_id
  • handle
  • value

Well, I’ve commented out the line before and it worked… It was another extension and the exact same function and error…

Inside the phpmyadmin I only have these fields inside the table symentriesdata_182

* id
* entry_id
* handle
* value

That’s odd. What you could try is to set every size field in every table that contains one to allow null.

Create an account or sign in to comment.

Symphony • Open Source XSLT CMS

Server Requirements

  • PHP 5.3-5.6 or 7.0-7.3
  • PHP's LibXML module, with the XSLT extension enabled (--with-xsl)
  • MySQL 5.5 or above
  • An Apache or Litespeed webserver
  • Apache's mod_rewrite module or equivalent

Compatible Hosts

Sign in

Login details