I want to import products from csv file. But how to get product images from an url? The csv file contain the image url and affiliate link too. I need to import this two fileds in specific places.
You should use an import tool which supports it. At least FastSimpleImport does it, but you need to build an import array from your csv for that (which you'll probably have to do anyways, as most probably the import format won't be the required magento format). See https://github.com/avstudnitz/AvS_FastSimpleImport/issues/108 for details about how to import images from URLs, and http://avstudnitz.github.io/AvS_FastSimpleImport/ for the general documentation.