Skip to main content

#Zip File0 utenti parlano di questo argomento

Static resources breaks in Visual Force Page rendered as PDF after changing a file inside the zip and re-uploading

 

I downloaded a working Static Resource used by a VF page and change an image, compressed the folder and re-upload again and ended-up with a not working VF page. None of the images were loading and the css not being applied.

 

I compared with other static resources and noticed a difference in the MIME type of file uploaded file.

The type of my re-uploaded zip file shows as "application/zip" vs the others showing as "application/x-zip-compressed". After many, but many posts reading, I realised this is not the root of the problem

 

Solution: When compressing the file, the individual folders inside the zip needs to be selected and compressed; whereas compressing the whole folder adds an extra folder to the path, breaking the link to the static resource from the VF page, eg.:

  • "myStaticResources.zip/myStaticResources/styles/style.css" instead of
  • "myStaticResources.zip/styles/style.css"

So the formula in the VF page: "{!URLFOR($Resource.myStaticResources, '/styles/style.css')}" won't work

 

Static resources breaks in Visual Force Page rendered as PDF after changing a file inside the zip and re-uploading I downloaded a working Static Resource used by a VF page and change an image, compres

 

Screenshot 2024-04-03 at 08.38.59.png

 

#VfPage  #Host Static Resource  #Upload Files  #Download Pdf  #Visualforce  #VisualForce Page  #Zip File

1 commento
  1. 5 lug 2025, 19:31

    OMG.  THANK YOU. 

    After hours of troubleshooting this, finally found your tip.  I was zipping up the folder also, and getting 404, pulling my hair out.  lol.  finally fixed.

0/9000
Armin Janosch ha postato nel feed di David Gibbons

Hi David, hi Community, 

 

following the link in the EA+ Training Video in min 18:19 for the training slides 

https://www.youtube.com/watch?v=rvsQRDGviQo&list=PLjJeA2SstEtIIwI30ULDS5XKmacqcLcmt

I was redirected to 

https://trailblazers.salesforce.com/0693A000007773I?retUrl=%2F_ui%2Fcore%2Fchatter%2Fcontent%2FGroupFileListPage%3Fg%3D0F9300000009MBP

where I can find a Zip File - but this Zip - File does not include the slides from all the training videos in EA+.

 

-> Please could you let me know where I can find the slides shown in the EA+ training videos?

 

And by the way - thanks for the execellent training videos ;-)

 

Regards

Armin 

0/9000