1

I have a resource, let's say image.jpg. This image(along with other resources) is compressed in a .zip file (archive.zip) under the path /favimage/image.jpg. The archive is uploaded at http://example.com/down/archive.zip.

Now I want to address this single resource (image.jpg) using a URI over the internet. Is there any scheme standard to do that?

Currently I use a fiat syntax. url-encoding is skipped for brevity: http://example.com/?0=http://example.com/down/archive.zip&1=/favimage/image.jpg

Here param 0 tells me the resource http://example.com/down/archive.zip encapsulates resource number 1 which is /favimage/image.jpg.

mike
  • 11
  • 2
  • Why do you want to do this? What are you trying to achieve? It seems like you are trying to let the user download multiple images at once in a zip file but select the images they want in some sort of list passed as a query param. Is that correct? – Cormac Mulhall Apr 09 '18 at 10:02
  • @CormacMulhall the scope is to address the content from from another mime type. The example with the archive(zip file) was one, another one may be the need to address a particular stream (audio or video) from a media file (i.e. .mkv) or a particular file from a torrent, or a particular file/fragment from an Email message. – mike Apr 10 '18 at 17:00
  • It sounds like you are asking can I request an individual file from inside the zip archive via the URL scheme of the server. The answer is probably not, not unless the server is specifically designed to let you do this. The server probably doesn't have any idea what a zip file is, it just knows it is a type of file it can return to you. You have to download the zip file, uncompress it, and then look at the uncompressed archive. This is really nothing to do with MIME types, and everything to do with zip files. – Cormac Mulhall Apr 13 '18 at 13:41

1 Answers1

1

No. There is no concept of stacked MIME types and resources in HTTP except the standard approach of the "path" part of the URL. Assuming you just want to link to the image, an example URL might be:

https://example.com/down/archive/favimage/images.jpg

and the server knows how to serve that image out of the zip file. The user does not need to know anything about the zip file - it is just an internal detail of how the server is storing the file.

If I've misinterpreted can you please expand on what the ultimate goal is?

noctonura
  • 281
  • 2
  • 7
  • I do not control the server. That's why I need a convention so that the client can figure out how to decode and extract the fragment that I need. Ideally the convention should be protocol agnostic (even though I'm currently using only http and file://). Currently I'm saving some state locally as workaround but it becomes a pain when I need to pass it around. – mike Apr 10 '18 at 17:45