decrypting encrypted file

when attempting to view a encrypted file:
undefined index: MIME_TYPES. in configuration at phpfn.php line 39put the decrypt code in the view form:
in:
func Page_Render()
tried a few things with same result:

    $this->attachment->CurrentValue = Decrypt($this->attachment->DbValue);
    $this->attachment->ViewValue = Decrypt($this->attachment->DbValue);

also added to class file:
at
function Row_Rendered() {
as
//var_dump($this->);
$this->atachment->CurrentValue = Decrypt($this->atachment->DbValue);
$this->atachment->ViewValue = Decrypt($this->atachment->DbValue);same results:

Decrypt is not related to $MIME_TYPES. Explain how you “attempting to view a encrypted file”. What settings or server event codes did you use?

hi arbei,not sure what i was thinking, I just set the field encryption “on” to that attachment field. its encrypting…same issue though:

  1. Cannot “view” the file from the view form… same error as above
    undefined index: MIME_TYPES. in configuration at phpfn.php line 39

are you not able to view a file once encrypted?what about if the document is being attached to an email, is that taken into consideration, or will have have to be “decrypted” first before attaching…thanks,

a note on attaching the file for emailing…does not work exception thrown:could not access file: filename.xlsx at phpmailer line xxxxwhich makes sense since the file is encrypted and does not contain the extensionwhat method should be used to “decrypt” the file, will the standard decrypt work?i have attached the document it in the Email_Sending class:

function Email_Sending($email, &$args) {
	$attach_file = _getDocumentPath($this->Account_Id->CurrentValue). $this->atachment->CurrentValue;
	$email->addAttachment($attach_file);

	return true;
}

thanks

For field encryption, check out the PhpEncrypt / PhpDecrypt function.

Hi arbei,i think there is an issue with the encryption/decryption systemcannot view the file either - throws a SLIM error – with the undefined index MIMES_TYPES. in config – not changes to this code - straight php generated…
Slim Application Error
A website error has occurred. Sorry for the temporary inconvenience.trying to decrypt the file with PHPDecrypt method appears to throw an error — but nothing is displayed (on the PhpDecrypt($attach_file, Config(“ENCRYPTION_KEY”)) – never returns)file appears encrypted on the file system:
def50200097d79dfa288afeace49eab30e19c30194f9435d929a485b7517908cfa7f80f75679885764928745f6df5008056162d96595fe25cd9c06cf9e84b29fa84c31de9b4ebba9c9c220be185897f95d66dd0c5687014ba9ee09e3a67dcfea7df5b9acac6c323ef255314304aa4e0a259802
as type “file”.in the table and field - set to TEXT
data in the field:def50200097d79dfa288afeace49eab30e19c30194f9435d929a485b7517908cfa7f80f75679885764928745f6df5008056162d96595fe25cd9c06cf9e84b29fa84c31de9b4ebba9c9c220be185897f95d66dd0c5687014ba9ee09e3a67dcfea7df5b9acac6c323ef255314304aa4e0a259802mime_type detected at insert:
application/vnd.openxmlformats-officedocument.spreadsheetml.sheettest file was an .xlsxnot sure where the problem could be

also noticed – can’t rename it or even open the file with any other application

Are you trying to encrypt/decrypt the file name, or the file content?Try encrypt/decrypt to verify that the stored file name/content is valid. For example:$oldValue = …; // Old value
$encrypted = PhpEncrypt($oldValue);
if ($oldValue == PhpDecrypt($encrypted)) { // Verify encrypted content
//… echo "old: " . $oldValue . ", encrypted: " . $encrypted . “
”;
}

Hi arbei,same issues… I sent the project, documents and notes to support to analyze.

Then I tried to upload a pdf file thinking it was just excel filetypes, it totally crapped out when attempting to upload - didn’t even get to saving the file.

You cannot encrypt a file upload type field…