I've fixed this particular problem with a different approach, that was made possible by a recent pull request that hasn't been documented yet.
The pull request introduced a new pipeline, called FilesPipeline: https://github.com/scrapy/scrapy/blob/master/scrapy/contrib/pipeline/files.py
I had to make the following changes to get this working:
- rename the
image_urls
field, that is used for the image pipeline, tofile_urls
in youritems.py
- activate the pipeline in your
settings.py
and define a storageITEM_PIPELINES = {'scrapy.contrib.pipeline.files.FilesPipeline': 1}
FILES_STORE = '/Users/chris/Scrapy/project/images'
Apart from those changes the pipeline works exactly like the image pipeline. Obviously this approach only works if you just need the file from the website in its original format.