function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
amitashtekaramitashtekar 

how to retrieve file names in a zipped static resouce file via apex

Hi all,

I want to retrieve file names within a zipped static resource file via apex.

can anybody help me.

I am stuck with this.

kiranmutturukiranmutturu

i think you can't access the static resource via apex...through visual force u can do rhis like 

URLFOR($Resource.<name>,'<path>') where <name> is the resource name and <path> is the path to that file within the ZIP file

LakshmanLakshman

If you want to access static resource through Apex then you will have to create a component which will set a parameter containing the {!$Resource.your_static_resource_name} and then you can access it in Apex by ApexPages.currentPage().getParameter().get('ur param');

 

Note:

If you want to have the Resource URL loaded before page i.e.. in constructor, it wont be possible, then you will have you use VFP only or create logic within VFP.

 

Regards,

Lakshman

vishalSharmavishalSharma

Appreciated your answer.

 

Can you please give me a example to create a component and controller for this.

 

Thanks,

vishal