Download image from a link with no extension

Post Reply
jabbafat
Posts: 9
Joined: 12 Jun 2013, 17:49

Download image from a link with no extension

Post by jabbafat » 17 Aug 2017, 16:15

I have several thousand links that have no extension but do contain a jpg file when opened using a browser.
Here is an example:
https://system.netsuite.com/core/media/ ... d2fac4fae2
How do I set the 'Target Files' so that EPF picks up the image from these links please?

Maksym
Site Admin
Posts: 2077
Joined: 02 Mar 2009, 17:02

Re: Download image from a link with no extension

Post by Maksym » 17 Aug 2017, 20:23

Well, generally speaking, if you want EPF to save files without extension you set the target files like this:

*.

But in this case you can use

*.jpg

as EPF will know that this file is a JPEG by response headers. So in your project you can use the "Current page only" exploration method and any of the above target files.

jabbafat
Posts: 9
Joined: 12 Jun 2013, 17:49

Re: Download image from a link with no extension

Post by jabbafat » 18 Aug 2017, 12:32

Thanks Maxim,
I tried all of those to no avail I'm afraid.
Is there anything else I can try please?

Maksym
Site Admin
Posts: 2077
Joined: 02 Mar 2009, 17:02

Re: Download image from a link with no extension

Post by Maksym » 18 Aug 2017, 17:09

OK, first of all - make sure you have the most recent version of the program:

http://www.webimagedownloader.com/download/

Here is the project I created using the instructions I provided above with a single URL that you gave. Please try it:

system.eu2.netsuite.com-1-file.epr

(use right-click menu item "Save link as...", then run downloaded file to open the project in EPF)

If it works - add the rest of your URLs to this project. If it doesn't - tell me what does it say in the download log.

jabbafat
Posts: 9
Joined: 12 Jun 2013, 17:49

Re: Download image from a link with no extension

Post by jabbafat » 18 Aug 2017, 17:54

Thanks Maxim,

Yes, yours works fine. But when I put the full list in it only downloads 1 image (the one from your example). I will have a look to see what is causing that. I will repost on Monday with the answer.

Thanks again for the help.

jabbafat
Posts: 9
Joined: 12 Jun 2013, 17:49

Re: Download image from a link with no extension

Post by jabbafat » 21 Aug 2017, 12:40

Ok I see the problem now. It works with just the starting addresses. But I hadn't mentioned in the previous post that I was appending the address in a similar fashion to how we did in a previous post viewtopic.php?f=4&t=7107&p=8034#p8034 which renames the images as they arrive.
I'm wondering if this is because the starting address already has a "?" in it.

So https://system.netsuite.com/core/media/ ... d2fac4fae2 works fine as a starting address

But https://system.netsuite.com/core/media/ ... em=Product does not work for me.
We use this setup regularly so we know it generally works. I've done all the normal stuff of ticking "Use value of this parameter for file name" and used "item" in the box as normal etc.

Maksym
Site Admin
Posts: 2077
Joined: 02 Mar 2009, 17:02

Re: Download image from a link with no extension

Post by Maksym » 21 Aug 2017, 14:46

If URL already contains parameters after "?", then new parameters are added with "&", not with another "?". Like this:

/media/media.nl?id=107388&c=590499&h=88e7534a8ad2fac4fae2&item=Product

In this case the "Use value of the following parameter for file name" should work just fine.

jabbafat
Posts: 9
Joined: 12 Jun 2013, 17:49

Re: Download image from a link with no extension

Post by jabbafat » 21 Aug 2017, 15:24

Yes, that's done it. It works fine now.

Thanks for your help once again Maxim.

Post Reply