This topic is locked

uploading files

6/5/2007 4:28:47 AM
PHPRunner General questions
L
lucian author

I have a table `docs` where I'm uploading files to a MySql database. The fields are `id`, `title`, `type`,`author`, `version`, `description`, `content`, `check_out`, `filename`, `filesize`,`date` (files are stored in 'content' - type BLOB).

I want to complete automatically the filesize field when a new record is added.

I used Before record added but it doesn't seems that works:

I tried followings:
$values["filesize"]=$_FILES["filename"]["size"];

$values["filesize"]=filesize($values["filename"]);

$values["filesize"]=filesize($_GET["filename"]);

Any solution?
Thank you,

Lucian

Alexey admin 6/5/2007

Lucian,
here is the code for BeforeRecordAdded event:

$values["filesize"]=strlen($values["content"]);

L
lucian author 6/5/2007

It works. Thank you Alexey.

Lucian,

here is the code for BeforeRecordAdded event: