cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Nicopita77
Helper I
Helper I

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
Super User IV
Super User IV

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 @Nicopita77 ,

 

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-co...

 

Best Regards,
Kelly

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

mahoneypat
Super User IV
Super User IV

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

Helpful resources

Announcements
PBI User Groups

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

secondImage

Are You Ready?

Test your skills now with the Cloud Skills Challenge.

Top Solution Authors