Cesare
Cesare

Reputation: 1749

Download a zip file using curl or wget

I need to download several zip files from this web page ....

http://www.geoportale.regione.lombardia.it/download-pacchetti?p_p_id=dwnpackageportlet_WAR_geoportaledownloadportlet&p_p_lifecycle=0&metadataid=%7B16C07895-B75B-466A-B980-940ECA207F64%7D

using curl or wget, so not in interactive way,

A sample url is the follow ...

http://www.geoportale.regione.lombardia.it/rlregis_download/service/package?dbId=323&cod=12

If I use this link in a new browser tab or window, all works fine but using curl or wget it's not possible to download the zipfile.

Trying to see what happen in the browser using Firebug, or in general the browser console, I can see that there is first a POST request and then a GET request (using Firebug ... ), so I'm not able to reproduce these requests using curl or wget.

Could be also that some cookies are sets in the browser session and the links do not work without that cookie?

Any suggestion will be appreciated ....

Cesare

NOTE: when I try to use a wget this is my result

enter image description here

NOTE 2: 404 Not found

enter image description here

NOTE 3 (the solution): the right command is

wget "http://www.geoportale.regione.lombardia.it/rlregis_download/service/package?dbId=323&cod=12"

then I've to rename the file in something like "pippo.zip" and this is my result, or, better using the -O option in this manner

wget "http://www.geoportale.regione.lombardia.it/rlregis_download/service/package?dbId=323&cod=12" -O pippo.zip

Upvotes: 0

Views: 6386

Answers (1)

Magd Kudama
Magd Kudama

Reputation: 3469

Looking at your command, you're missing the double quotes. Your command should be:

wget "http://www.geoportale.regione.lombardia.it/rlregis_download‌​/service/package?dbI‌​d=323&cod=12"

That should download it properly.

Upvotes: 2

Related Questions