0

I had a compressed static resource file with lots of styling and javascript files. I just downloaded that file and re-uploaded again but after uploading it no styling and javascript is getting loaded.

I am really frustrated at this problem because not able to figure out the why is this happening for 2 hours

Static resource i uploaded with name : NewResource MIME Type application/x-zip-compressed

My code :

<apex:page controller="NMAT_LoginContoller" showHeader="false" sidebar="false" standardStylesheets="false" docType="html-5.0" title="Register">     

  <head>
    <apex:stylesheet value="{!URLFOR($Resource.NewResource, 'assets/css/bootstrap.min.css')}"/>
    <apex:stylesheet value="{!URLFOR($Resource.NewResource, 'assets/css/bootstrap-datetimepicker.min.css')}"/>
    <apex:stylesheet value="{!URLFOR($Resource.NewResource, 'assets/css/chosen.min.css')}"/>
    <apex:stylesheet value="{!URLFOR($Resource.NewResource, 'assets/styles/scss/style.scss')}"/>
    <apex:stylesheet value="{!URLFOR($Resource.NewResource, 'assets/styles/scss/vars.scss')}"/>
    <apex:stylesheet value="{!URLFOR($Resource.NewResource, 'assets/css/style.css.map')}"/>
    <apex:stylesheet value="{!URLFOR($Resource.NewResource, 'assets/css/fonts.css')}"/>
    <apex:stylesheet value="{!URLFOR($Resource.NewResource, 'assets/css/style.css')}"/>
    <apex:stylesheet value="{!URLFOR($Resource.NewResource, 'assets/css/vars.css')}"/>
    <apex:stylesheet value="{!URLFOR($Resource.NewResource, 'assets/css/vars.css.map')}"/>           
 </head>        

Rest of vf page

  • Request you to share your code what you've tried... – user4567570 Jun 26 '17 at 19:19
  • 1
    did you clear your browser cache? is the file being loaded? do you have any errors in your console? is the file loading in your network tab...Please update your post accordingly. Thanks – glls Jun 26 '17 at 19:19
  • Did you extract it and then compress again but compress at the wrong folder level? – Dan Wooding Jun 26 '17 at 19:47
  • 1
    Triple check the ZIP that you haven't introduced a folder at the root (before "assets"). – Keith C Jun 26 '17 at 19:47
  • 1
    Dan Wooding was correct...i had my path wrong because of compression and decompression – Dnyaneshwar Jun 26 '17 at 20:28
1

I had a similar issue where this became an issue. What you need to do instead of doing "Send To > Compressed (zipped) folder" on the folder, do it on the files inside the folder.

When you compress the folder itself, you end up with "foo.zip/foo/bar.js" instead of "foo.zip/bar.js".

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.