Of course you could override this behaviour but i would use alternative method provided by Suite.
I’ve cerated a zip package that execute a post install script which should retrieve a file content.
the alternative method looks like:
require_once('include/upload_file.php');
$uploadFile = new UploadFile();
//get the file location
$uploadFile->temp_file_location = UploadFile::get_upload_path($file_id);
$file_contents = $uploadFile->get_file_contents();
But how retrieve a specific file content inside a specific folder(ex: subdirectory inside my scripts folder in the zip package) if i don’t know the $file_id?
Whose “official documentation” is that? And where does it say " file_get_contents() function is disabled by default"? I don’t find that there… :huh:
It seems the UploadFile class is for files you upload into SuiteCRM as Docuements/Attachements/etc. I wouldn’t use it unless that is really the sort of object you want to handle.
I’m not sure exactly what your requirements are, but i would say If you’re just doing your own processing, stick to the regular PHP functions. You will surely find many examples of handling stuff inside zips. Then when you have your data sorted out you can put into SuiteCRM objects.
Not sure this helps, but it’s the best advice I can give with what I know…
I’m sorry, I never used that UploadFile class and I don’t know exactly how it is meant to be used…
From a brief view, it looks like it’s meant for files uploaded into SuiteCRM (through notes and attachments) so probably you can get the file_id if you are able to upload it along with one of those beans. But I might be completely lost on this.