1

I want to give files from zip in static resource. How can i do it? It gives me 404 on getContent() anyway: with file ending(png,txt, etc) and without.

    PageReference pageRef = PageReference.forResource('Zip','File.csv');
    PageReference contentRef = new PageReference(pageRef.getUrl().split('\\?')[0]);
    
    System.debug(contentRef.getContent());

Tried another way but same error.Link without File.csv is valid and i can download that file.

StaticResource sr = [SELECT Id,SystemModstamp FROM StaticResource WHERE Name = 'Zip'];
String srPath = '/resource/' + sr.SystemModstamp.getTime() + '/Zip/File.csv'; 
PageReference pg = new PageReference(srPath);
String body = pg.getContent().toString(); 

1 Answer 1

0

Doesnt work with 7z. Didn't pay attention to it. With zip works good.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .