cancel
Showing results for 
Search instead for 
Did you mean: 

Load a zip file from a download url link

nisars
New Contributor III

Hello,

Is it possible to extract data from the download link - NaPTAN and NPTG - NaPTAN - DfT

A file reader snap or a zip file reader only recognises this as a file as an asp.net file - Naptan.ashx, however clicking on the link downloads a zipped file containing 16 csv files.

Thank you for your help

1 ACCEPTED SOLUTION

Take a look at this pipeline, which I created to enable you to download the file, extract the contents from the zip file, and then remove the downloaded Zipfile.
ZipFile_2018_08_08.slp (13.2 KB)

View solution in original post

6 REPLIES 6

nisars
New Contributor III

Thank you all @tlui, @dmiller and @cstewart.

The pipeline is great. Much appreciated. Have been able to get all my data through without issues now.

bgiles
Former Employee

Note for readers from the future: the snap peeks at the first few bytes of the file to determine if it’s a .zip or .7z file. It doesn’t look at the file extension. Those are standard values and it’s not an exaggeration to say that if those bytes aren’t set then it’s not a .zip or .7z file. Since some applications that support additional formats will quietly use the correct decoder it’s possible that you think you have a .zip file but it’s actually something else.

When in doubt it’s best to create an empty archive, or one with just a single entry, and attach it your question. That allows us to verify how the third party library we use is identifying the file. There are some proprietary extensions the zip format, e.g., to support strong encryption, and it’s possible that the library is returning an unrecognized MIME type. We won’t be able to read the encrypted entries but we could provide a more meaningful error message in this case.