This topic is locked

post editing: saving uploads as files PLUS blobs

5/20/2010 4:08:46 PM
PHPRunner General questions
P
phppaul author

I made an app using PHPrunner 5.2, using blobs for several fields for internal db-storage.

but now, due to an additional db-access via ODBC (which does NOT support BLOBS ->FileMaker), the contents of those blobs must also be available as external files.

I'd usually try to add an event in PHPrunner, but unfortunately the customer has done a lot of post-editing of the original php files.

Hence I must figure out which php-file(s) I must change in which way to make the uploaded content not only stored in a blob field but as an external file too.
So far I found some functions in the _edit.php where the POST data is processed like

// delete & move files

foreach ($files_delete as $file)

{

if(file_exists($file))

@unlink($file);

}

foreach ($files_move as $file)

{

move_uploaded_file($file[0],$file[1]);

if(strtoupper(substr(PHP_OS,0,3))!="WIN")

@chmod($file[1],0777);

}


or, more specific on one of the fields in question:

if(!$inlineedit)

{

$value = postvalue("value_CV");

$type=postvalue("type_CV");

if (in_assoc_array("type_CV",$_POST) || in_assoc_array("value_CV",$_POST) || in_assoc_array("value_CV",$_FILES))

{

$value=prepare_for_db("CV",$value,$type,postvalue("filename_CV"));

}

else

$value=false;

if(!($value===false))

{
$evalues["CV"]=$value;

$efilename_values["CVfileref"]=$filename;

}

if($filename)

$efilename_values["CVfileref"]=$filename;


But I still do not know how I should proceed <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=question&id=14471&image=1&table=forumtopics' class='bbc_emoticon' alt=':(' />

I do have a hand-made .php function which exports ALL blobs to external files, but I want it to happen record-wise after each update.
thanks in advance!
Paul

A
ann 5/21/2010

Paul,
All updating and uploading of files occur in the functions DoInsertRecordSQL/DoUpdateRecordSQL in source\include\commonfucntions.php to insert your code. Those functions can be used to insert a custom code.

P
phppaul author 5/21/2010



Paul,
All updating and uploading of files occur in the functions DoInsertRecordSQL/DoUpdateRecordSQL in output\include\commonfucntions.php to insert your code. Those functions can be used to insert a custom code.


Thanks Ann! I'll give it a try.

(The support in this forum is superb! AAA++)

P
phppaul author 5/25/2010



Paul,
All updating and uploading of files occur in the functions DoInsertRecordSQL/DoUpdateRecordSQL in output\include\commonfucntions.php to insert your code. Those functions can be used to insert a custom code.


I can't find functions of that name (DoInsertRecordSQL or DoUpdateRecordSQLin commonfunctions.php. ?

(PHPrunner 5)

A
ann 5/25/2010

Paul,
what version of PHPRunner do you use?