Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

Help Connecting to a Zip File from a Web source

Hi guys,

I need help to solve this problem.

 

I have this source:

 

http://res1104.se.gob.ar/adjuntos/precios_eess_2013_en_adelante.zip

 

I use WEB SOURCE to connect the file and I can't decompress it. My code is this:

 

let
Source = Web.Contents("http://res1104.se.gob.ar/adjuntos/precios_eess_2013_en_adelante.zip"),
Decompress = Binary.Decompress(Source, Compression.GZip)
in
Decompress

 

The error PowerQuery show me is:   

DataFormat.Error: The magic number in GZip header is not correct. Make sure you are passing in a GZip stream.

 

How can I do to solve it?

 

Thanks a lot.

 

 

1 ACCEPTED SOLUTION
mahoneypat
Employee
Employee

Looks like it is not a GZip format.  You can replace Compression.GZip with one of the other compression types.  Just start typing Compression to see the options (if intellisense is enabled in your file).

If one of those doesn't work, you can try the custom function described in this article.

Reading Zip files in PowerQuery / M (sql10.blogspot.com)

 

Regards,

Pat





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


View solution in original post

2 REPLIES 2
v-kelly-msft
Community Support
Community Support

Hi @Anonymous ,

 

Modify the M code as below:

let
Source = Web.Contents("http://res1104.se.gob.ar/adjuntos/precios_eess_2013_en_adelante.zip",[Headers=[#"Accept-Encoding"="gzip"]]),
Decompress = Binary.Decompress(Source, Compression.GZip)
in
Decompress

Check the similar thread below:

https://stackoverflow.com/questions/33790650/does-power-query-support-accept-encoding-gzip-in-web-contents

 

Best Regards,
Kelly

Did I answer your question? Mark my post as a solution!

mahoneypat
Employee
Employee

Looks like it is not a GZip format.  You can replace Compression.GZip with one of the other compression types.  Just start typing Compression to see the options (if intellisense is enabled in your file).

If one of those doesn't work, you can try the custom function described in this article.

Reading Zip files in PowerQuery / M (sql10.blogspot.com)

 

Regards,

Pat





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors
Top Kudoed Authors