I uploaded my zip file which contains css and js folder here is my zip folder structure:

static resource name: mystaticresources


Aura component:

          styles="{!$Resource.mystaticresources + '/myuploadzip/css/mycss.css'}" 
          $Resource.mystaticresources + '/myuploadzip/js/jquery211.js', 
          $Resource.mystaticresources + '/myuploadzip/js/myjs1.js')}"                  
 afterScriptsLoaded="{!c.doInit}" />


 doInit: function(component, event, helper) {


I could not able to see what is wrong with the above code? I'm not getting alert!

I have jquery upload as a file without zip file and I have this reference in my component then it works:

 <ltng:require scripts="{!$Resource.jquery211}" afterScriptsLoaded="{!c.doInit1}"/> 
  • Can you please provide the full code so I can try to reproduce?
    – nickforce
    Commented Dec 4, 2019 at 2:34
  • Do you see any errors in console for the case that's not working ? Have scripts been successfully loaded ? Commented Dec 4, 2019 at 2:47
  • I started seeing the error now net::ERR_ABORTED 404 (Not Found) and trying to fetch from https://myawesome-dev-ed.lightning.force.com/resource/1575229828000/mystaticresources/myuploadzip/js/jquery211.js hmmm i'm not sure why i'm getting 404
    – Nick
    Commented Dec 4, 2019 at 2:56

1 Answer 1


ZIP Inside ZIP

If you have a ZIP inside the ZIP, this will fail. You can't access the resources inside of that file, as the system won't repeatedly/recursively decompress files this way.

You can verify this by downloading the static resource itself in your browser:


If the first entry you see is a ZIP file, your static resource won't work the way you expect. To fix this, ZIP the files you want into a ZIP, but do not ZIP that ZIP.

Normal ZIP Without Internal ZIP

The name of the ZIP isn't included in the file path; simply start from the js and css folders:

          styles="{!$Resource.mystaticresources + '/css/mycss.css'}" 
          $Resource.mystaticresources + '/js/jquery211.js', 
          $Resource.mystaticresources + '/js/myjs1.js')}"                  
 afterScriptsLoaded="{!c.doInit}" />
  • Thanks @sfdcfox for your reply but unfortunately it does not work with your suggestion :(
    – Nick
    Commented Dec 4, 2019 at 17:53
  • @NickKahn Did you fix your file?
    – sfdcfox
    Commented Dec 4, 2019 at 18:57
  • I don't have zip inside zip, I have posted the structure of my zip folder in my question so I have a zip file within that zip file I have two folders.
    – Nick
    Commented Dec 4, 2019 at 19:00
  • so if I open a new browser and try to access this page https://myawesome-dev-ed.lightning.force.com/resource/1575229828000/mystaticresources I do get the zip file downloaded but when I try to do https://myawesome-dev-ed.lightning.force.com/resource/1575229828000/mystaticresources/js/jquery211.js I get 404
    – Nick
    Commented Dec 4, 2019 at 19:02
  • @NickKahn What's in your zip file?
    – sfdcfox
    Commented Dec 4, 2019 at 19:29

You must log in to answer this question.

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