Select to view content in your preferred language

How to dynamically zip a shapefiles which created in silverlight api 2.4 at  runtime?

431
1
05-17-2012 07:06 AM
XiujuZhou
Emerging Contributor
In my silverlight API 2.4 application, it allows user to do spatial query. the query result as feature set is saved to a shapefiles which created by a geoprocessing service using in the application. the shapefiles are located in  in a sub-folder with JOBID in ArcGISJobs folder for user download. I have the downloading a file function but cannot download a folder, so I need to zip those files into a zip file so that user can download this file.  the question is that how to zip those files at runtime by silverlight application? Any help is appreciated!
0 Kudos
1 Reply
wangzhifang
Frequent Contributor
Actually, the Silverlight app does not compress these files for you.
What you need to do is to make your result shapefiles into a zip file on server side, more specifically, these should be done as one part job of your geoprocessing service.
You need to write python script to do this, grab your shapefiles as middle result, zip them into one file, and make this zip file as final gp service result to be downloaded.
Here's sample code of how to zip and unzip files in python:
http://help.arcgis.com/en/arcgisserver/10.0/help/arcgis_server_dotnet_help/0093/009300000037000000.h...
0 Kudos