Cannot create a new Static Resource zip file from within the IDE

Issue #440 resolved
Mike Bernard created an issue

I want to create a new static resource (application/zip) that I can then convert to a Resource Bundle and then add new JavaScript files to it.

When I right click -> New -> Static Resource...I name the file and set the MIME Type to application/zip. When I try to deploy it to the server, it errors with "...Static Resource is not a valid zip file."

My guess as to why this is happening is that it is empty, therefore it isn't a .zip file yet. However, this seems like some weird chicken and egg situation where I cannot create a resource bundle from a zip because creating a static resource that is a zip must have contents in it before I can create the resource bundle. But without creating the resource bundle, I can't add any files to the zip.

Comments (10)

  1. Scott Wells repo owner

    Thanks for logging this, Mike. It's been rattling around in my mind for a while and I keep forgetting to capture it here. You're correct that it creates an empty file that's not a valid zip archive. The ugly workaround is to copy a zip file over the empty file...the key word being "ugly".

    Question for you...would you rather I create a stub/empty zip file when the content type is application/zip (or another zip MIME type), or would you rather have a Browse button from which an existing archive might be selected? Or both?

  2. Mike Bernard Account Deactivated reporter

    I would rather just have a stub zip that I can then just convert to a static resource bundle and add files to it.

    Thanks for the quick response!! Happy to help you any way I can!

  3. Scott Wells repo owner

    Good to know. That's what I figured. It matches the expected use case of seeding a resource bundle from the IDE. That should be quite easy to address. I'll see if I can fit it into a near-term release.

  4. Scott Wells repo owner

    Change submitted and will be included in 1.7.5.3. I've also added application/zip to the drop-down list of content types for convenience. Note that it's technically not valid to create a completely empty zip file, so I include one entry, PLACEHOLDER.txt, that you can remove once you've added a legitimate entry to the resource bundle.

  5. Mike Bernard Account Deactivated reporter

    Incredible turnaround! This will save us a ton of time! Thanks again!

  6. Log in to comment