Welcome Guest, Not a member yet? Register   Sign In
How to encrypted name of an uploaded file?
#1

[eluser]Katsune[/eluser]
Hi,

How can I get the name of the uploaded file once it is encrypted? I use this:
Code:
$config['encrypt_name']=true;


but I cant find the way to get the name.

Before, I use this
Code:
$file_name=gettext($_FILES['userfile']['name']);
but it only get the actual file name before being encrypted.

Anyone?

Thanks,
#2

[eluser]InsiteFX[/eluser]
Save the encrypted file name to a static variable or a session variable then you will have it.
#3

[eluser]Katsune[/eluser]
Hi,

I got it now,

This code gets all the data config for the file to be uploaded, including the encrypted name:
Code:
$upload_data = $this->upload->data();

now this code bellow here calls specifically the 'file_name' which is the holder of the encrypted name:
Code:
$file_name = $upload_data['file_name'];

I dont know why it was named 'file_name' but I think it's the default because I never initialized this name, and my multipart form uses name="userfile"


Thanks,




Theme © iAndrew 2016 - Forum software by © MyBB