AnsweredAssumed Answered

On demand File Restrictions

Question asked by Ajay Kumar on Apr 24, 2017
Latest reply on Apr 25, 2017 by Altaf Ur Rehman

Hi Sugar community,

 

I tried bringing export.php and download.php to custom directory which is available in sugar root directory.I am able to copy root files to custom.And i have added my logic there. And  I tried converting these two files into module loadable package and tried upload in on demand instance.

I am not able to upload my package and i have received following error.

 

Invalid usage of a function ini_set()
Invalid usage of a function file_exists()
Invalid usage of a function getimagesize()

Invalid usage of a function filesize()
Invalid usage of a function set_time_limit()
Invalid usage of a function ob_start()
Invalid usage of a function readfile()

Invalid usage of a function copy()
Invalid usage of a function usort()

Invalid usage of a function mkdir_recursive()
Invalid usage of a function sugar_file_put_contents()
Invalid usage of a function file_put_contents()
Invalid usage of a function unlink()

Invalid usage of a function pathinfo()

Invalid usage of a function $function()
Invalid usage of a function is_writable()
Invalid usage of a function $class()

 

However by following below sugar article,i have alternative functions for file_exists(),getimagesize() and copy().

 

 

Two questions.

1.I have copied export.php from root directory and placed into custom directory and added my logic with existing line of code.As export.php doesnot have class there ,i am not able extend the class.

Q1 : Is there any alternative way to bring this file to custom instead of copying entire file ?

 

2. Alternative for above functions?

 

Please advice me.

 

With Best Regards

Ajay Kumar B

Outcomes