Skip to content

Commit

Permalink
Fix for previous commit to work when uploading encrypted files to cou…
Browse files Browse the repository at this point in the history
…chdb
  • Loading branch information
bradymiller committed Nov 7, 2012
1 parent 36e7915 commit 56163af
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion controllers/C_Document.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -122,11 +122,12 @@ function upload_action_process() {
$tmpfile = fopen( $_FILES['file']['tmp_name'][$key] , "r" );
$filetext = fread( $tmpfile, $_FILES['file']['size'][$key] );
$plaintext = $this->decrypt( $filetext, $passphrase );
fclose($tmpfile);
unlink( $_FILES['file']['tmp_name'][$key] );
$tmpfile = fopen( $_FILES['file']['tmp_name'][$key], "w+" );
fwrite( $tmpfile, $plaintext );
fclose( $tmpfile );
$_FILES['file']['size'][$key] = filesize( $tmpfilepath.$tmpfilename );
$_FILES['file']['size'][$key] = filesize( $_FILES['file']['tmp_name'][$key] );
}

$docid = '';
Expand Down

0 comments on commit 56163af

Please sign in to comment.