1

I'm trying to download a CSS file using wget - quite a simple task I would say, but whenever I try downloading the CSS file I receive a corrupted/mis-formatted file, containing lines like these:

wں��_�m�^{���|&�gC�H�4�I�d�޳�m����V��;��%Y6�w��K�K#i4��F#���D�g;�J`FO�ꪲ�l׉+��_D�s`�JU7�D��w*ފ��W^;�r�t�a���<��M�t�c?\N<�v���_���&0��7����P{�י���M63Ӷ���U�V9�V���Me匞<(ҜU&�;��7�X����9�f�ܙ�(�=gv�B����C�T��ϕ�i=!��yhZ��t��2'��M��}o�C�8�7�pW�f����

Here is the source CSS file

The things is: downloading other files works just fine, there must be something wrong specifically with this file...

I tried updating wget - same output.

Tried using curl - same output.

I'd appreciate any help! Thanks :)

2 Answers 2

4

The server is serving a gzip compressed file to reduce the amount of data that is sent. It might not be doing that for everything it serves, but it certainly is for this file.

You can use the --compressed curl option to uncompress what it returns:

curl --compressed "http://daks2k3a4ib2z.cloudfront.net/56938a33feb451344a7acab7/css/compass-hls.eedd6aab0.min.css"
Sign up to request clarification or add additional context in comments.

Comments

2

Download the file with wget and check it with file:

$ wget -O foo.css http://daks2k3a4ib2z.cloudfront.net/56938a33feb451344a7acab7/css/compass-hls.eedd6aab0.min.css

$ file foo.css
foo.css: gzip compressed data, from Unix

Download the file with wget, write it to stdout, uncompress it, write it to a file and check it with file:

$ wget -O - http://daks2k3a4ib2z.cloudfront.net/56938a33feb451344a7acab7/css/compass-hls.eedd6aab0.min.css | gunzip > foo.css

$ file foo.css
foo.css: ASCII text, with very long lines, with no line terminators

2 Comments

On my machine, the upzip part isn't necessary. using wget by itself is enough, or even opening the URL directly from Kate.
Figured it out myself just before you wrote it haha! But thanks allot nevertheless :) Really appreciate the help * reassurance!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.